# Send Email

```json
// Body sample
{
    "name": "Welcome Email",
    "from":"John@email.com", 
    "fromName": "John from SmarthiveSMS",
    "to":["johndoe@email.com","chalesJames@email.com"], 
    "subject":"Welcome to Smarthive SMS", 
    "html":"Your HTML code",
    "ext_ref":"3823_juw"
}

```

{% hint style="info" %}

```
ext_ref is an optional field. The value must be unique
```

{% endhint %}

## Send

<mark style="color:green;">`POST`</mark> [https://api.smarthivesms.com](https://smsapi-sur2.onrender.com)`/api/email/campaign/send_campaign`

This endpoint allows you to send SMS Message

#### Headers

| Name                                        | Type   | Description  |
| ------------------------------------------- | ------ | ------------ |
| x-api-key<mark style="color:red;">\*</mark> | String | Your API Key |

#### Request Body

| Name                                       | Type                           | Description                                                                   |
| ------------------------------------------ | ------------------------------ | ----------------------------------------------------------------------------- |
| name<mark style="color:red;">\*</mark>     | String                         | The name or label for the email campaign or template (used internally).       |
| from<mark style="color:red;">\*</mark>     | String                         | The sender's email address.                                                   |
| fromName<mark style="color:red;">\*</mark> | String                         | The name to display as the sender (e.g., brand or personal name).             |
| to<mark style="color:red;">\*</mark>       | `array[string]`                | A list of recipient email addresses.                                          |
| subject<mark style="color:red;">\*</mark>  | The subject line of the email. | The subject line of the email.                                                |
| html<mark style="color:red;">\*</mark>     | String                         | The HTML content of the email body.                                           |
| ext\_ref                                   | String                         | External reference ID for tracking the request (e.g., unique transaction ID). |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "status": "ok",
    "description": "Emails processed",
    "message": "Campaign started",
    "campaignId": "68489c7a62af22a517701da6"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smarthive-tech-solution.gitbook.io/smarthive-tech-solution-api/email/send-email.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
