Send a message
Sends an outgoing message to a conversation, a contact, or a phone number. The API creates the contact and the conversation when they do not exist. Before it accepts plain content, the API checks the service window of the conversation. A 201 means that the API saved the message and put it in the delivery queue. It does not mean that the channel delivered it.
Authentication
An API key that an administrator creates in Settings > Developer. The personal access token of a user does not work. A key reaches every inbox, conversation, and contact in the account that created it, and nothing in other accounts.
Path parameters
The id of your account. It is the number after /accounts/ in the dashboard URL.
Request
The conversation number in the dashboard URL (display_id). The conversation gives the inbox, so inbox_id is not necessary.
The id of a contact. The API uses the most recent conversation of the contact on inbox_id with a status other than resolved, or it opens a new conversation. The contact must have an address that the channel can reach. If it has none, the API returns contact_not_messageable.
A phone number in E.164 format, for example +971500000000. The API creates the contact if it does not exist. Only WhatsApp, Twilio, and SMS inboxes accept a phone number.
The inbox that sends the message. Necessary if the request has no conversation_id.
The text of the message. Optional when template_params is present on a WhatsApp inbox: the API then makes the text from the body of the approved template. A Twilio inbox always needs content.
Sends an approved WhatsApp template instead of free text. A template is necessary to start a conversation on WhatsApp, or to send after the 24-hour service window closes. When this field is present, the API does not check the service window on any channel. Send it only on an inbox that has approved templates.
The fields of a new contact. The API reads them only with phone_number, and only when no contact has that number.
Response
The conversation number in the dashboard URL (display_id).
The delivery status at the time of the response. A new message is sent. The dashboard shows the later status.