Message types
Every message — inbound and outbound — is addressed with a single chatId and
is either text or media:
- Text — a flat top-level
textstring. - Media — a
mediaobject with an explicitmedia.type.
Exactly one of text / media is present. All field names are camelCase
(chatId, mimeType, quoteMessageId).
{ "chatId": "972501234567", "text": "Hello"}Media types (v1)
Section titled “Media types (v1)”The media.type is required — Teiwah uses it to build the correct WhatsApp send
payload.
media.type | Purpose | Key fields |
|---|---|---|
image | Image | url or base64, caption? |
ptt | Voice note | url or base64 |
audio | Generic audio file | url or base64 |
video | Video | url or base64, caption? |
document | File / document | url 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" }}Media fields
Section titled “Media fields”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.
Validation rules
Section titled “Validation rules”chatIdis required on outbound and present on inbound.- Exactly one of
textormediais present. - When
mediais present,media.typeis required and the content must match the type.
{ "chatId": "972501234567", "media": { "type": "document", "url": "https://example.com/invoice.pdf" }}Invalid (media present, type missing)
Section titled “Invalid (media present, type missing)”{ "chatId": "972501234567", "media": { "url": "https://example.com/invoice.pdf" }}For the machine-readable schema, see the API Reference.