Send a message

Sends an outgoing message, addressing it by conversation, by contact, or by raw phone number. The contact and conversation are created when they do not exist yet. A 201 means the message was accepted and queued for delivery, not that the channel has confirmed it.

Authentication

api_access_tokenstring

An API key created in Settings > Developer. A user token works too and is useful while you experiment. A key is authorized at the account level: it reaches every inbox, conversation and contact in the account that issued it, and nothing outside that account.

Path parameters

account_idintegerRequired
Your account id.

Request

This endpoint expects an object.
contentstringRequired>=1 character
The message body. Always required. For a template send this is what your agents see in the conversation thread.
conversation_idintegerOptional

An existing conversation’s display id. The inbox is taken from the conversation, so inbox_id is not needed.

contact_idintegerOptional

An existing contact. The most recent unresolved conversation on inbox_id is reused, or a new one is opened. The contact needs an address the channel can reach, a phone number for WhatsApp or an email for email. Without one the request fails with contact_not_messageable.

phone_numberstringOptionalformat: "^\+[1-9]\d{1,14}$"

A phone number in E.164 format, for example +971500000000. The contact is created if it does not exist. Only WhatsApp, Twilio and SMS inboxes can be addressed this way.

inbox_idintegerOptional

The inbox to send from. Required unless conversation_id is given.

template_paramsobjectOptional

Sends an approved WhatsApp template instead of a plain text message. Required to start a conversation, or to continue one whose 24 hour customer service window has closed. Supplying this field skips the messaging-window check on every channel, so only send it on a channel that supports templates.

contactobjectOptional

Attributes for a contact that is about to be created. Only read on the phone_number path, and only when no contact with that number exists yet.

Response

The message was created and queued for delivery.
idintegerOptional
The message id.
conversation_idintegerOptional
The conversation's display id.
contact_idintegerOptional
inbox_idintegerOptional
statusenumOptional

The delivery status at the moment of the response. A newly queued message is sent; later transitions are visible in the dashboard.

contentstringOptional
created_atintegerOptional
Unix timestamp, in seconds.

Errors

401
Unauthorized Error
404
Not Found Error
422
Unprocessable Entity Error