Messages
Send text, reply buttons and media inside an open conversation.
These endpoints send free-form messages. On WhatsApp they only reach the customer within
24 hours of the customer's last message; outside that window, send a
template instead. All need scope message:send.
Text
POST /v1/messages/text sends text into the contact's
latest conversation, on whichever channel it is (WhatsApp or web chat). Up to 4,096 characters.
{
"audienceExternalId": "249912345678:123456789012345",
"text": "Your order has shipped."
}audienceExternalId identifies the contact. For WhatsApp it is
<phone number>:<your WhatsApp phone number ID>. It is also how you address the
handover, conversations and
tickets endpoints.
Reply buttons
POST /v1/messages/buttons sends a WhatsApp message
with one to three reply buttons. Button titles are 2–20 characters.
{
"channelId": "3f6c1a2e-8b4d-4c7a-9e21-5d0b7f3a6c19",
"to": "249912345678",
"interactive": {
"body": { "text": "Was your issue resolved?" },
"footer": { "text": "Enigma Support" },
"buttons": [
{ "id": "resolved_yes", "title": "Yes" },
{ "id": "resolved_no", "title": "No" }
]
}
}When the customer taps a button, you receive an inbound_message webhook.
If you leave out a button's id, it defaults to the lowercased title.
Media
POST /v1/messages/media sends an image, video, audio,
document or sticker. Set media.type and fill the object with the same name, using a public
link or a WhatsApp mediaId.
{
"channelId": "3f6c1a2e-8b4d-4c7a-9e21-5d0b7f3a6c19",
"to": "249912345678",
"media": {
"type": "document",
"document": {
"link": "https://example.com/invoice-10234.pdf",
"filename": "invoice-10234.pdf",
"caption": "Your invoice"
}
}
}Response
{ "success": true, "messageId": "wamid.HBgLMjQ5OTEyMzQ1Njc4FQIAERgS" }Buttons and media are WhatsApp-only: on any other channel they return { "success": false }
and send nothing.