Send a message
Send one message or one grouped media album from the session.
Use type in the body to select a supported payload (text, poll, location, contact).
Default mode is synchronous and returns 200. Set async=true for queued async sends that return 202.
Idempotency is enabled with Idempotency-Key.
Errors: validation_error, not_found, rate_limited, and not_implemented for unsupported types.
Send Authorization: Bearer <token>. The token can be a login JWT from the frontend or an api-key for a script. JWT access comes from the person's organization role. Api-key access comes from the permissions saved on the key.
In: header
Path Parameters
WhatsApp session id that sends the message. Must be owned and connected.
"01HZX..."Query Parameters
Set true to queue the send and return 202. False (default) waits for WhatsApp and returns 200.
falseHeader Parameters
Optional idempotency token. Reusing the key returns the first send result and does not send again.
"2f1c9b6e-7a3d-4c2e-9f8a-1b2c3d4e5f60"Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Optional single caption for an album. WhatsApp renders it with the grouped album.
"Trip photos"The contact card to share. Required for type contact.
Latitude of the shared location in decimal degrees. Required for type location.
double-6.2Longitude of the shared location in decimal degrees. Required for type location.
double106.816666The media file to send. Required for the media types (image/video/audio/document/sticker); provide exactly one of media.data (base64) or media.url (HTTP(S)). Caption, replyTo, and mentions apply.
The ordered album items. Required for type album; 2–10 image/video items, each with exactly one of data or url.
JIDs to @-mention in the message. Optional.
Example
[ "6289876543210@s.whatsapp.net"]For a poll, the poll question; for a location, the place label. Required for poll; optional for location.
"Lunch on Friday?"The poll's answer options. Required for type poll.
Example
[ "Yes", "No", "Maybe"]Optional poll closing time as epoch milliseconds. Used for type poll when WhatsApp supports poll end times.
int641719662400000When true, ask WhatsApp to hide participant names in the poll vote list. Used for type poll.
trueId of the message this one quotes/replies to (a wa_message_id). Optional.
"3EB0C431C26A1916E001"How many options a voter may pick in the poll (1 = single choice). Used for type poll.
int641The message text. Required for type text; ignored otherwise.
"Hello there!"The recipient's JID: a user JID for a direct message (e.g. 6281234567890@s.whatsapp.net) or a group JID for a group (e.g. 120363021234567890@g.us). Required.
"6281234567890@s.whatsapp.net"Which kind of message to send. The media types use media; album uses medias with 2–10 images/videos and an optional shared caption. Each media source may independently be base64 data or an HTTP(S) URL.
"text"Value in
- "text"
- "poll"
- "location"
- "contact"
- "image"
- "video"
- "audio"
- "document"
- "sticker"
- "album"
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/sessions/01HZX.../messages" \ -H "Content-Type: application/json" \ -d '{ "to": "6281234567890@s.whatsapp.net", "type": "text" }'{ "mode": "string", "outboxId": "string", "replayed": true, "status": "string", "timestamp": 0, "waMessageId": "string"}{ "error": { "code": "not_found", "details": { "property1": null, "property2": null }, "message": "session not found" }}