message object:
type is one of text, template, interactive or media; content depends on it.
Each endpoint accepts the types that make sense for it: for example a Shortext inbound message is
text only.
Text
string
required
The text, up to 4,096 characters. On WhatsApp, a URL in the text is rendered as a link.
Template
string
required
The template name, as listed by
GET /templates.string
required
The template language, for example
fr or en_US. The template must be approved in this language.object
The body variables, by name:
{ "name": "Brice", "order": "A-1042" }. For templates with numbered variables ({{1}}, {{2}}), give a list of WhatsApp parameters in order.object
For a text header with variables:
{ "name": "value" }. For a media header: { "url": "https://..." } (and filename for a document). Without url, the media stored with the template is sent.object
The value of each button that needs one, by its index (from 0, as listed by
GET /templates): { "0": "A-1042", "1": "SAVE20" }. The end of a dynamic link, the coupon of a copy-code button, or the payload of a quick reply.string
For an authentication template only: the one-time code (up to 15 characters). Shortext puts it in the body and in the code button.
1002 with an explicit message when the template does not exist on the number, is not approved in that language, or misses a variable (body.missing lists them). See Send a template.
Interactive
string
required
button (reply buttons), cta_url (a button that opens a link), flow, payment or carousel. Their action is described in WhatsApp message types.string
required
The text of the message.
array | object
required
For
button: a list of 1 to 3 buttons { "id", "title" } (title up to 20 characters). For cta_url: { "parameters": { "display_text", "url" } }. For the other types, see WhatsApp message types.object
{ "type": "text" | "image" | "video" | "document", "value": "text or URL", "filename": "for documents" }. A text header is limited to 60 characters; cta_url accepts a text or an image header.Up to 60 characters.
Media
string
required
image, video, document or audio.string
required
A public URL Shortext can download the file from.
string
Up to 1,024 characters (not for audio).
string
The file name shown for a document.
string
The MIME type, for example
application/pdf.Messages in responses and webhooks
Messages returned by the API and sent inmessage.* webhooks wrap the same object:
directionisinbound(from the contact) oroutbound(from the AI agent, a member of your team or the API).message.idis the id on the channel (WhatsApp message id; on a Shortext endpoint, your own message id).statusisreceivedfor inbound messages, thensent,delivered,readorfailedfor outbound ones; changes are pushed by themessage.statuswebhook.