Skip to content

Message types

Every message — inbound and outbound — is a message object discriminated by type. message.type is always required, and the remaining fields must match the type.

TypePurposeKey fields
textPlain textbody
imageImagemediaUrl or base64, caption?
pttVoice notemediaUrl or base64
audioGeneric audio filemediaUrl or base64
videoVideomediaUrl or base64, caption?
documentFile / documentmediaUrl or base64, filename?
locationGeographic locationlatitude, longitude, name?, address?

ptt and audio are intentionally separate: voice notes are often transcribed, while audio files are treated as generic attachments.

For media types, provide either mediaUrl (preferred) or base64 (≤ 16 MB decoded). mimeType and filename are optional and usually inferred.

  • to is required on outbound messages.
  • from is present on inbound webhooks.
  • message is required.
  • message.type is required.
  • Message content must match the selected type.
{
"to": "972501234567",
"message": {
"type": "document",
"mediaUrl": "https://example.com/invoice.pdf"
}
}
{
"to": "972501234567",
"message": {
"mediaUrl": "https://example.com/invoice.pdf"
}
}

For the machine-readable schema, see the API Reference.