Send message

POST/v1/messages

Queue a text, media or interactive message in an open conversation, or a template in any, or to a phone with no conversation yet.

Scope messages:writeIdempotency-Key required

Request body

To an existing conversation, or to a contact on one of its channels, by Customer ID or by phone. A template to a contact with no conversation yet opens one.

conversation_idstring, uuid
customer_idstring
9 digits or more
phonestring
E.164, such as +237690000099
channel_idstring, uuid
typeenumRequired
One of text, template, image, video, audio, document, sticker, interactive
contentobject
reply_to_message_idstring, uuid
templateobject
A template synced from Meta, by name. language is needed only when it has several
template.namestringRequired
1 to 512 characters
template.languagestring
Up to 20 characters
template.variablesobject
One value for each {{n}} of the template's header (at most one place) and body, in order. A header of image, video or document format takes [{"media_key": "..."}] instead

Response

  • 202Success
Response fields
message_idstringRequired
conversation_idstringRequired
seqintegerRequired
directionstringRequired
sourcestringRequired
authorobjectRequired
May be null
typestringRequired
contentobjectRequired
reply_to_message_idstringRequired
May be null
attachmentsarray of object
Default
attachments[].idstringRequired
attachments[].kindstringRequired
attachments[].mime_typestringRequired
May be null
attachments[].file_namestringRequired
May be null
attachments[].size_bytesintegerRequired
May be null
statusstringRequired
read_inferredbooleanRequired
provider_message_idstringRequired
May be null
errorobjectRequired
May be null
error.codestringRequired
error.messagestringRequired
error.provider_codeintegerRequired
May be null
error.detailsobjectRequired
May be null
created_atstring, date-timeRequired
queued_atstring, date-timeRequired
May be null
submitted_atstring, date-timeRequired
May be null
sent_atstring, date-timeRequired
May be null
delivered_atstring, date-timeRequired
May be null
read_atstring, date-timeRequired
May be null
rejected_atstring, date-timeRequired
May be null
failed_atstring, date-timeRequired
May be null

Errors

  • 400idempotency_key_required
  • 401unauthorized. The key is missing, unknown or revoked
  • 403insufficient_scope. The key lacks the scope above
  • 404not_found. no conversation with this contact
  • 409channel_disconnected, idempotency_conflict
  • 422validation_error, details.fields names what is wrong, window_closed, contact_blocked, media_invalid, template_invalid
  • 503unavailable. media storage is not configured

Every error has the same shape. See Errors.