Skip to content

Message types

Every message — inbound and outbound — is addressed with a single chatId and is either text or media:

  • Text — a flat top-level text string.
  • Media — a media object with an explicit media.type.

Exactly one of text / media is present. All field names are camelCase (chatId, mimeType, quoteMessageId).

{
"chatId": "972501234567",
"text": "Hello"
}

The media.type is required — Teiwah uses it to build the correct WhatsApp send payload.

media.typePurposeKey fields
imageImageurl or base64, caption?
pttVoice noteurl or base64
audioGeneric audio fileurl or base64
videoVideourl or base64, caption?
documentFile / documenturl or base64, filename?

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

{
"chatId": "972501234567",
"media": {
"type": "document",
"url": "https://example.com/invoice.pdf"
}
}

For media messages, provide either url (preferred) or base64 (≤ 16 MB decoded). mimeType and filename are optional and usually inferred. See Working with media for inbound vs. outbound details.

  • chatId is required on outbound and present on inbound.
  • Exactly one of text or media is present.
  • When media is present, media.type is required and the content must match the type.
{
"chatId": "972501234567",
"media": {
"type": "document",
"url": "https://example.com/invoice.pdf"
}
}
{
"chatId": "972501234567",
"media": {
"url": "https://example.com/invoice.pdf"
}
}

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