# POST Send Message API

**API Endpoint**

```
https://api-v7.express-chat.com/whatsapp-automation/wa/templates?apiKey=*API KEY*
```

**Request Headers**

| Header       | Details                                         |
| ------------ | ----------------------------------------------- |
| apiKey       | <p>*API KEY*</p><h4 id="query-params"><br></h4> |
| Content-Type | application/json                                |

Plain Text MessagesMedia Messages

**Request Body**

{% tabs %}
{% tab title="Plain text Messages" %}
**Request Body**

```
{
    "userName": "Test",
    "wa_id": "910987654321",
    "type": "text",
    "message": {
        "text": "hi"
    },
    "tags": [ "test" ]
}
```

#### Parameters

| Parameter      | Type   | Description                                                                                                                        |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| userName       | string | The name of the user to whom the message is being sent.                                                                            |
| wa\_id         | string | The WhatsApp number of the user to whom the message is being sent. The number must contain the country code without the plus sign. |
| type           | string | The type of message being sent (e.g., text, image).                                                                                |
| message.text   | string | message that needs to sent                                                                                                         |
| message.label  | string | <p>The caption you want to send along with the image<br><em>(optional) Only if type is image</em></p>                              |
| message.source | string | <p>The image link<br><em>(optional) Only if type is image</em></p>                                                                 |
| tags           | array  | Tags are the labels that you can assign to conversations or chats to help organize and manage effectively.                         |
| {% endtab %}   |        |                                                                                                                                    |

{% tab title="Media Messages" %}
**Request Body**

```
{
    "userName": "Test",
    "wa_id": "910987654321",
    "type": "text",
    "message": {
        "text": "hi"
    },
    "tags": [ "test" ]
}
```

#### Parameters

| Parameter      | Type   | Description                                                                                                                        |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| userName       | string | The name of the user to whom the message is being sent.                                                                            |
| wa\_id         | string | The WhatsApp number of the user to whom the message is being sent. The number must contain the country code without the plus sign. |
| type           | string | The type of message being sent (e.g., text, image).                                                                                |
| message.text   | string | message that needs to sent                                                                                                         |
| message.label  | string | <p>The caption you want to send along with the image<br><em>(optional) Only if type is image</em></p>                              |
| message.source | string | <p>The image link<br><em>(optional) Only if type is image</em></p>                                                                 |
| tags           | array  | Tags are the labels that you can assign to conversations or chats to help organize and manage effectively.                         |
| {% endtab %}   |        |                                                                                                                                    |
| {% endtabs %}  |        |                                                                                                                                    |

#### Error Codes <a href="#error-codes" id="error-codes"></a>

Refer to the [official documentation](https://developers.facebook.com/docs/whatsapp/on-premises/errors) for more information on error codes.
