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.
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, uuidcustomer_idstring- 9 digits or more
phonestring- E.164, such as +237690000099
channel_idstring, uuidtypeenumRequired- One of
text,template,image,video,audio,document,sticker,interactive contentobjectreply_to_message_idstring, uuidtemplateobject- A template synced from Meta, by name.
languageis 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_idstringRequiredconversation_idstringRequiredseqintegerRequireddirectionstringRequiredsourcestringRequiredauthorobjectRequired- May be null
typestringRequiredcontentobjectRequiredreply_to_message_idstringRequired- May be null
attachmentsarray of object- Default
attachments[].idstringRequiredattachments[].kindstringRequiredattachments[].mime_typestringRequired- May be null
attachments[].file_namestringRequired- May be null
attachments[].size_bytesintegerRequired- May be null
statusstringRequiredread_inferredbooleanRequiredprovider_message_idstringRequired- May be null
errorobjectRequired- May be null
error.codestringRequirederror.messagestringRequirederror.provider_codeintegerRequired- May be null
error.detailsobjectRequired- May be null
created_atstring, date-timeRequiredqueued_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_required401unauthorized. The key is missing, unknown or revoked403insufficient_scope. The key lacks the scope above404not_found. no conversation with this contact409channel_disconnected,idempotency_conflict422validation_error, details.fields names what is wrong,window_closed,contact_blocked,media_invalid,template_invalid503unavailable. media storage is not configured
Every error has the same shape. See Errors.