Send a message
Send a message to a contact through one of your connected channels.
POST
/messages/sendAuthentication
This endpoint authenticates with your API key sent in the X-API-Key header (ek_live_... format). You can manage your API keys from the Dev Tools section of the dashboard.
Required parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
to | String | Required | Phone number or platform identifier of the recipient. |
from | String | Required | Channel identifier (e.g. whatsapp). |
type | MessageType | Required | Type of message to be sent. |
content | MessageContent | Required | Content of the message. |
channel_uuid | String | Required | UUID of the WhatsApp phone number to send from. You can copy it from the Phone Numbers section of the dashboard, or from the id field of the phone number in the API. |
Optional parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
template_uuid | String | Optional | Template message identifier. |
optin_contact | Boolean | Optional | Confirms the customer's opt-in status. |
template_values | Array | Optional | Placeholder values for template variables. |
assigned_user | String | Optional | Email address of the assignee. |
team_uuid | String | Optional | UUID of the team to assign the conversation to. |
fields | String | Optional | Comma-separated extra fields to include: contact, conversation. |
bot_status | String | Optional | Bot state: bot_start or bot_end. |
metadata | Object | Optional | Custom key-value pairs (max 10 pairs). |
Example request
bash
curl -X POST "https://eclectic-api-537143970188.us-central1.run.app/api/external/v2/messages/send" \
-H "X-API-Key: ek_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"to": "+31612345678",
"from": "whatsapp",
"type": "text",
"channel_uuid": "35f6f8cc-b550-4278-a2ea-099f3a4e0730",
"content": {
"text": "Hello!"
}
}'Example response
json
{
"message": {
"uuid": "adf3d1216d4c4dcd908199d6700f2381",
"status": "enqueued"
}
}Notes
- Outside the 24-hour customer service window a template message is required.
- Images, documents, audio and video are supported via a url field inside the content object.
- metadata accepts up to 10 key-value pairs; keys up to 50 characters, values up to 500 characters.