Messaging
Send Template Messages
Send a pre-approved WhatsApp template to any customer, including those outside the 24-hour session window ✅
POST
Send Template Messages
Template messages are pre-approved formats managed in your WhatsApp Manager (inside Facebook Business Manager). Because Meta approves them in advance, you can send them to any customer at any time — including first-time contacts and customers whose 24-hour session has expired.
Rate limit: 200 requests/second. Exceeding this returns
The
Available
See Error codes for the full list of error types and codes.
Your template must be created and approved in WhatsApp Manager before you can reference it here. Contact the Connectly team if you need help getting a template approved.
Endpoint
429 Too Many Requests.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Recipient’s WhatsApp number in E.164 format (e.g. +16502223333). To target a BSUID customer, use the prefixed form bsuid:US.…. |
templateName | string | Yes | Exact name of the approved template in your WhatsApp Manager. |
language | string | Yes | Language code for the template translation (e.g. en, en_US, pt_BR, es). The template must have an approved translation for this language. |
parameters | array | No | Variable substitution objects. See Template parameters below. |
sender | string | No | Your WhatsApp sender number in E.164 format. Only required when you have more than one WhatsApp number registered with Connectly. |
callbackData | any | No | Up to 1024 bytes of JSON echoed back in webhook events for this message. See callbackData. |
campaignName | string | No | Tags this send with a campaign name for analytics. |
Response
id uniquely identifies the message. Use it to correlate delivery status webhook events (sent, delivered, read, delivery_failed).
Template parameters
Theparameters array substitutes variables in your template’s header, body, and buttons. Each object has a name and value, plus an optional filename for document headers.
name values:
| Category | Name | Description |
|---|---|---|
| Header | header_text | Substitutes a text variable in the template header. |
| Header | header_image | Sets a header image — value must be a public image URL. |
| Header | header_document | Sets a header document — value must be a public document URL. Pair with filename to control the displayed file name. |
| Body | body_1 … body_15 | Substitutes the 1st through 15th variable in the template body, in order. |
| Buttons | button_1_url_suffix | Appended to the base URL of button 1. |
| Buttons | button_2_url_suffix | Appended to the base URL of button 2. |
| Buttons | button_3_url_suffix | Appended to the base URL of button 3. |
| Carousel | card.N.header.image | Image URL for carousel card N (zero-indexed). |
| Carousel | card.N.body.M | Body variable M of carousel card N (both zero-indexed). |
| Carousel | card.N.button.M.urlSuffix | URL suffix for button M of carousel card N. |
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
Text header + body variables
Text header + body variables
Image header + body variables (Brazilian Portuguese)
Image header + body variables (Brazilian Portuguese)
Document header
Document header
Link button with URL suffix (Spanish)
Link button with URL suffix (Spanish)
Carousel template
Carousel template
Create the carousel template first using the Template Management API, then reference it here with per-card parameters.
To receive events when recipients tap carousel buttons, subscribe to the Webhook API.
Send from a specific number (multi-sender)
Send from a specific number (multi-sender)
Include
sender when your business has more than one WhatsApp number registered with Connectly.Template languages
Your template can have multiple approved language translations. Specify the correct code in thelanguage field — the template must have an approved translation for the language you request. See Meta’s language list for all supported codes.
| Language | Code |
|---|---|
| English | en |
| English (US) | en_US |
| Brazilian Portuguese | pt_BR |
| Spanish | es |
Targeting by BSUID
To target a customer identified by a Business-Scoped User ID, setnumber to the prefixed form bsuid:US.… (e.g. bsuid:US.13491208655302741918). See Business-scoped user IDs (BSUID) for full details.
Error responses
| Status | Meaning |
|---|---|
400 | Malformed body, unapproved template, or callbackData exceeds 1024 bytes. |
401 | Missing or invalid X-API-Key. |
429 | Rate limit exceeded (200 req/s). |
500 | Internal server error. |
