Skip to main content
Every endpoint that sends a message (start a conversation, reply, Shortext inbound, v1.0 send) and every message in a response or a webhook uses the same message object:
type is one of text, template, interactive, media, location or contact; 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.
boolean
default:"true"
On WhatsApp, show a preview of the first link of the text. false sends the link without its preview.

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.
The billing category is the one Meta approved for the template. In v2.0, Shortext checks a template before sending it to WhatsApp and answers 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), quick_reply (an alias of button), list (a menu of options in sections), 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 and quick_reply: a list of 1 to 3 buttons { "id", "title" } (title up to 20 characters). For list: { "button", "sections": [ { "title", "rows": [ { "id", "title", "description" } ] } ] }. 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.
See what they look like on WhatsApp in WhatsApp message types.

Media

string
required
image, video, document, audio or sticker.
string
required
A public URL Shortext can download the file from.
string
Up to 1,024 characters (not for audio and stickers).
string
The file name shown for a document.
string
The MIME type, for example application/pdf.

Sticker

A sticker is a media message with media_type sticker: a WebP image of 512 x 512 pixels, 100 KB at most (500 KB if animated), without caption.

Location

number
required
From -90 to 90.
number
required
From -180 to 180.
string
The name of the place, up to 255 characters.
string
Its address, up to 1,000 characters.
With a name and an address, the place shows as a place card; otherwise as a position on a map.

Contact

string
required
The first name (or the name of the service), up to 255 characters.
string
Up to 255 characters.
array
required
1 to 5 numbers { "number", "type" }. type is cell (default), main, iphone, home or work.

Rendering by channel

Messages in responses and webhooks

Messages returned by the API and sent in message.* webhooks wrap the same object:
  • direction is inbound (from the contact) or outbound (from the AI agent, a member of your team or the API).
  • message.id is the id on the channel (WhatsApp message id; on a Shortext endpoint, your own message id).
  • A position shared by a contact (WhatsApp or Telegram) arrives with message.type location and its content (latitude, longitude, name, address); its readable text is “name, address, map link”. On Telegram, a phone number shared by a contact arrives with the type contacts. The AI agent reads these messages and answers them.
  • status is received for inbound messages, then sent, delivered, read or failed for outbound ones; changes are pushed by the message.status webhook.