Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
send
/
whatsapp_templated_messages
Send Template Messages
curl --request POST \
  --url https://api.example.com/v1/businesses/{businessId}/send/whatsapp_templated_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.
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.
Template messages can only be sent to personal WhatsApp accounts — not to WhatsApp API (business) accounts. When testing, use your personal WhatsApp number and make sure it has accepted all WhatsApp app and privacy updates.

Endpoint

POST /v1/businesses/{businessId}/send/whatsapp_templated_messages
POST https://api.connectly.ai/v1/businesses/{businessId}/send/whatsapp_templated_messages
Rate limit: 200 requests/second. Exceeding this returns 429 Too Many Requests.

Request body

FieldTypeRequiredDescription
numberstringYesRecipient’s WhatsApp number in E.164 format (e.g. +16502223333). To target a BSUID customer, use the prefixed form bsuid:US.….
templateNamestringYesExact name of the approved template in your WhatsApp Manager.
languagestringYesLanguage code for the template translation (e.g. en, en_US, pt_BR, es). The template must have an approved translation for this language.
parametersarrayNoVariable substitution objects. See Template parameters below.
senderstringNoYour WhatsApp sender number in E.164 format. Only required when you have more than one WhatsApp number registered with Connectly.
callbackDataanyNoUp to 1024 bytes of JSON echoed back in webhook events for this message. See callbackData.
campaignNamestringNoTags this send with a campaign name for analytics.

Response

{ "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV" }
The id uniquely identifies the message. Use it to correlate delivery status webhook events (sent, delivered, read, delivery_failed).

Template parameters

The parameters 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.
"parameters": [
  { "name": "header_document", "value": "https://example.com/invoice.pdf", "filename": "invoice.pdf" },
  { "name": "body_1", "value": "John" },
  { "name": "body_2", "value": "Order #98765" }
]
Available name values:
CategoryNameDescription
Headerheader_textSubstitutes a text variable in the template header.
Headerheader_imageSets a header image — value must be a public image URL.
Headerheader_documentSets a header document — value must be a public document URL. Pair with filename to control the displayed file name.
Bodybody_1body_15Substitutes the 1st through 15th variable in the template body, in order.
Buttonsbutton_1_url_suffixAppended to the base URL of button 1.
Buttonsbutton_2_url_suffixAppended to the base URL of button 2.
Buttonsbutton_3_url_suffixAppended to the base URL of button 3.
Carouselcard.N.header.imageImage URL for carousel card N (zero-indexed).
Carouselcard.N.body.MBody variable M of carousel card N (both zero-indexed).
Carouselcard.N.button.M.urlSuffixURL suffix for button M of carousel card N.

callbackData

Set callbackData 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
Plain-text replies that don’t quote the original message do not include callbackData. Exceeding 1024 bytes returns a 400 error.
{
  "number": "+16044441234",
  "templateName": "order_confirmation",
  "language": "en",
  "parameters": [{ "name": "body_1", "value": "John" }],
  "callbackData": { "order_id": "12345" }
}

Examples

{
  "number": "+16044441234",
  "templateName": "my_template_name",
  "language": "en",
  "parameters": [
    { "name": "header_text", "value": "Hello" },
    { "name": "body_1", "value": "John" },
    { "name": "body_2", "value": "red" }
  ]
}
{
  "number": "+16044441234",
  "templateName": "external_header_test2",
  "language": "pt_BR",
  "parameters": [
    { "name": "header_image", "value": "https://i.picsum.photos/id/695/200/300" },
    { "name": "body_1", "value": "Connectly.ai" },
    { "name": "body_2", "value": "John" },
    { "name": "body_3", "value": "a new party" },
    { "name": "body_4", "value": "McDonald's" },
    { "name": "body_5", "value": "celebrate" }
  ]
}
{
  "number": "+16044441234",
  "templateName": "external_header_document",
  "language": "en",
  "parameters": [
    {
      "name": "header_document",
      "value": "https://example.com/invoice.pdf",
      "filename": "invoice.pdf"
    }
  ]
}
Include sender when your business has more than one WhatsApp number registered with Connectly.
{
  "sender": "+14151111234",
  "number": "+16044441111",
  "templateName": "order_confirmation",
  "language": "en",
  "parameters": []
}

Template languages

Your template can have multiple approved language translations. Specify the correct code in the language field — the template must have an approved translation for the language you request. See Meta’s language list for all supported codes.
LanguageCode
Englishen
English (US)en_US
Brazilian Portuguesept_BR
Spanishes

Targeting by BSUID

To target a customer identified by a Business-Scoped User ID, set number to the prefixed form bsuid:US.… (e.g. bsuid:US.13491208655302741918). See Business-scoped user IDs (BSUID) for full details.
Sending to phone-less (BSUID-only) customers is not yet available and currently returns a 400 error. Authentication templates (one-tap, zero-tap, copy-code) cannot use BSUIDs — they require a phone number.

Error responses

StatusMeaning
400Malformed body, unapproved template, or callbackData exceeds 1024 bytes.
401Missing or invalid X-API-Key.
429Rate limit exceeded (200 req/s).
500Internal server error.
See Error codes for the full list of error types and codes.