Send a message

Send a message to a contact through one of your connected channels.

POST/messages/send

Authentication

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

ParameterTypeRequiredDescription
toStringRequiredPhone number or platform identifier of the recipient.
fromStringRequiredChannel identifier (e.g. whatsapp).
typeMessageTypeRequiredType of message to be sent.
contentMessageContentRequiredContent of the message.
channel_uuidStringRequiredUUID 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

ParameterTypeRequiredDescription
template_uuidStringOptionalTemplate message identifier.
optin_contactBooleanOptionalConfirms the customer's opt-in status.
template_valuesArrayOptionalPlaceholder values for template variables.
assigned_userStringOptionalEmail address of the assignee.
team_uuidStringOptionalUUID of the team to assign the conversation to.
fieldsStringOptionalComma-separated extra fields to include: contact, conversation.
bot_statusStringOptionalBot state: bot_start or bot_end.
metadataObjectOptionalCustom 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.