Messaging
Send Session Messages
Send a free-form text, media, location, or interactive message within an active 24-hour WhatsApp session 🗺️
POST
Send Session Messages
Session messages are free-form messages — no pre-approval required. You can send text, attachments, location pins, and interactive messages (list menus, reply buttons). The only constraint is WhatsApp’s 24-hour eligibility window.
Rate limit: 200 requests/second. Exceeding this returns
The
See Error codes for the full list of error types and codes, including
The 24-hour rule
| Situation | Endpoint to use |
|---|---|
| Customer messaged you within 24 hours | POST …/send/messages (this endpoint) |
| No message from customer in over 24 hours | POST …/send/whatsapp_templated_messages |
| First-ever contact with a customer | POST …/send/whatsapp_templated_messages |
Endpoint
429 Too Many Requests.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
recipient | object | Yes | The customer to send to. |
recipient.id | string | Yes | Customer’s WhatsApp number in E.164 format (e.g. +16044441111), or bare BSUID. |
recipient.channelType | string | Yes | Set to whatsapp. |
recipient.name | string | No | Customer’s display name. |
message | object | Yes | The message content. Provide exactly one content type: text, attachments, location, listMessage, replyButtonMessage, singleProductMessage, or multiProductMessage. |
message.id | string | No | Optional message identifier (e.g. 01FPW47QF69Y5JZH24605VAKQB). |
message.text | string | No | Plain text body. Required when sending multiProductMessage; optional for singleProductMessage; standalone text for all other messages. |
message.attachments | array | No | Up to one attachment per message. Each item has type (image, video, audio, document), url (public URL), optional caption, and optional filename (document only). |
message.location | object | No | A location pin. Fields: latitude, longitude, name, address. |
message.listMessage | object | No | An interactive list message with sections and selectable rows. See WhatsApp docs. |
message.replyButtonMessage | object | No | An interactive message with up to 3 quick-reply buttons. See WhatsApp docs. |
message.singleProductMessage | object | No | Send a single product from your Meta catalog. Fields: footer.text, catalogId, productItem.productRetailerId. See WhatsApp docs. |
message.multiProductMessage | object | No | Send multiple catalog products grouped into sections. Fields: header, footer, catalogId, sections[].title, sections[].productItems[].productRetailerId. See WhatsApp docs. |
message.referral | object | No | Read-only. Populated on inbound messages triggered by a Click-to-WhatsApp ad. Fields: sourceUrl, sourceId, sourceType, headline, body, mediaType, imageUrl, videoUrl, thumbnailUrl, ctwaClid. See WhatsApp docs. |
message.isEcho | boolean | No | Set to true if the message was sent from the business itself. |
sender | object | No | Specifies which of your WhatsApp numbers to send from. Omit if you only have one number. |
sender.id | string | No | Your WhatsApp sender number in E.164 format (e.g. +14151111234). |
sender.channelType | string | No | Set to whatsapp. |
sender.name | string | No | Display name for the sender. |
callbackData | any | No | Up to 1024 bytes of JSON echoed back in webhook events for this message. See callbackData. |
campaignName | string | No | Tags this message with a campaign name for analytics (e.g. test_campaign_2022-03-12). |
order | object | No | Optional config to control event dispatching order. |
order.parentId | string | No | ID of the parent message this event depends on. |
order.strategy | string | No | Dispatch strategy. One of independent or short_circuit. Defaults to strategy_unspecified. |
Response
id uniquely identifies the message. Use it to correlate delivery status webhook events.
callbackData
SetcallbackData to any JSON value up to 1024 bytes. Connectly echoes it back in every webhook event tied to this message:
- Delivery status events —
sent,delivered,read,delivery_failed - Inbound replies that reference this message — quoted replies, button & list replies, reactions
callbackData. Exceeding 1024 bytes returns a 400 error.
Examples
Plain text message
Plain text message
Image attachment
Image attachment
Video attachment
Video attachment
Audio attachment
Audio attachment
Document attachment
Document attachment
Location message
Location message
Interactive list message
Interactive list message
Use You can also use a media header instead of text. Both list and reply-button messages share the same header structure:For a document header with a filename:
listMessage to present a scrollable menu. See WhatsApp interactive list docs for full spec.Interactive reply-button message
Interactive reply-button message
Send from a specific number (multi-sender)
Send from a specific number (multi-sender)
Include the
sender object when your business has more than one WhatsApp number.Targeting by BSUID
To target a customer identified by a Business-Scoped User ID, setrecipient.userId to the bare BSUID (e.g. US.13491208655302741918). See Business-scoped user IDs (BSUID) for full details.
Error responses
| Status | Meaning |
|---|---|
400 | Malformed body, session window expired, or callbackData exceeds 1024 bytes. |
401 | Missing or invalid X-API-Key. |
429 | Rate limit exceeded (200 req/s). |
500 | Internal server error. |
ERROR_CODE_MESSAGE_OUTSIDE_OF_ELIGIBILITY_WINDOW.