Send a message

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

POST/messages/send

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 channel used to send the message.

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://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.