Send a message
Send a message to a contact through one of your connected channels.
POST
/messages/sendRequired 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 channel used to send the message. |
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://api.try-eclectic.com/v1/messages/send" \
-H "Authorization: Bearer test_gshuPaZoeEG6ovbc8M79w0QyM" \
-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.