Connectly Documentation
  • 👋Welcome to Connectly.ai
  • 🚀Quick Start
    • Prerequisites
    • Authentication
    • Send WhatsApp template message
    • Send WhatsApp session message
  • 📣Campaigns
    • Campaign Sendout
      • Send Campaigns
  • 🤖Sofia AI
    • How to use Sofia AI?
    • Sofia AI API
      • Reference
        • Core Concepts
        • sales_assistant_v2/invoke/v1
  • 📱Message API
    • Message Service API
      • MessageService
        • Send template message
        • Send session message
      • Error codes
    • Webhook API
      • WebhookService
        • Create a webhook registration by event topic
        • Update an existing webhook registration by event topic
        • Get webhook registrations for business
        • Delete a webhook registration for business
      • Webhook Payload
        • Delivery Status Error Codes
        • Payload Media Types
  • 🤖Business Management
    • Business Management API
      • Template Management
        • Create a template
        • Get templates
      • Quality Signals
  • 📱Integrations
    • Integrations
      • WebEngage Integration
      • Message your customers on Zendesk through Connectly
      • Message your customer on Intercom through Connectly
    • [Alpha] Moengage
      • MessageService
        • Send Campaign via API
  • 📊Analytics
    • Analytics
      • [Alpha] Campaign report
      • Reports API
        • Webhooks configuration
  • 👀FAQ
  • Migrating WhatsApp Accounts
  • How to use time delay?
Powered by GitBook
On this page
  1. Message API
  2. Message Service API
  3. MessageService

Send template message

API to send a WhatsApp templated message to recipient.

PreviousMessageServiceNextSend session message

Last updated 2 months ago

This API requires an approved template. You can create a template using Create a template, which will then be automatically reviewed by Meta. Once approved, you can use it here to send messages.

WhatsApp template messages can be sent only to personal WhatsApp accounts not WhatsApp API accounts. If you are testing WhatsApp templated message API please use your personal WhatsApp phone number instead of your business phone number on Connectly.

Make sure your personal WhatsApp account you are using for testing has accepted all of WhatsApp app and privacy updates

24 hour WhatsApp restriction

If the recipient has not initiated the conversation first within the last 24 hours you MUST use templated message API /v1/businesses/{businessId}/send/whatsapp_templated_messages.

  • Generally, you use /v1/businesses/{businessId}/send/messages to reply to the customers who already messaged you first.

  • You use /v1/businesses/{businessId}/send/whatsapp_templated_messages to initiate with the customer first.

Select the WhatsApp number you want to send from

The endpoint supports an optional sender field in the body. If you have multiple WhatsApp phone numbers with Connectly you can choose which one you want to send the message from. The payload needs to contain the optional sender key specifying the phone number.

{
     "sender": "+14151111234",
     "number": "+1(604) 585 2331",
     "templateName": "template", 
     "language": "en",
     "parameters": []
}

Template languages

Your template can have different language translations which is why you need to provide the language in the API call.

Your template must have a language translation approved before you can use it for that specific language.

In most cases, the default template language is `en`.

Most common languages for templates

Brazilian Portuguese

{
    "number": "16044441234",
    "templateName": "my_brazilian_template",
    "language": "pt_BR",
    "parameters": []
}

Spanish

{
    "number": "16044441234",
    "templateName": "my_spanish_template",
    "language": "es",
    "parameters": []
}

How to use template parameters

The template parameters is a list of objects in the following format:

"parameters": [
   {
      "name": "header_document",
      "value": "YOUR_VALUE",
      "filename": "NAME_OF_DOCUMENT_FILE" // Only applicable to header_document
   }, 
   {
      "name": "body_1",
      "value": "YOUR_VALUE"
   },
   {
      "name": "body_2",
      "value": "YOUR_VALUE"
   },
   {
      "name": "body_3",
      "value": "YOUR_VALUE"
   }
]

Available options for name keys

Header

  1. header_text - indicates text in the header. Works only if the header has any variables in it. Substitutes the variables with the specified text.

  2. header_document - indicates document in the header. The value must be a valid URL with valid document. You can also specify how to name the file using filename parameter. See examples below.

Body

  1. body_1 - indicates text in the body

  2. body_2 - indicates text in the body

  3. body_3 - indicates text in the body

  4. body_4 - indicates text in the body

  5. body_5 - indicates text in the body

  6. body_6 - indicates text in the body

  7. body_7 - indicates text in the body

  8. body_8 - indicates text in the body

  9. body_9 - indicates text in the body

  10. body_10 - indicates text in the body

  11. body_11 - indicates text in the body

  12. body_12 - indicates text in the body

  13. body_13 - indicates text in the body

  14. body_14 - indicates text in the body

  15. body_15 - indicates text in the body

Buttons

  1. button_1_url_suffix - indicates URL link in the button. The value must be a valid URL

  2. button_2_url_suffix - indicates URL link in the button. The value must be a valid URL

  3. button_3_url_suffix - indicates URL link in the button. The value must be a valid URL

Examples

You have a template with one header variable and several body variables

{
    "number": "16044441234",
    "templateName": "my_template_name",
    "language": "en",
    "parameters": [
        {
            "name": "header_text",
            "value": "Hello"
        },
        {
            "name": "body_1",
            "value": "John"
        },
        {
            "name": "body_2",
            "value": "red"
        }
    ]
}

You have a template with a header image and multiple body variables

{
    "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 lol"
        }
    ]
}

You have a template with a header document

{
    "number": "16044441234",
    "templateName": "external_header_document",
    "language": "en",
    "parameters": [
        {
            "name": "header_document",
            "value": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
            "filename": "feelssss"
        }
    ]
}

You have a template with the link button and button has a suffix

{
    "number": "16044441234",
    "templateName": "external_link_button",
    "language": "es",
    "parameters": [
        {
            "name": "button_1_url_suffix",
            "value": "connectlyai"
        }
    ]
}

The above payload will send a template where "Our Facebook" button will take the customer to www.facebook.com/connectlyai

You have a template with two quick reply buttons

If you have subscribed to Connectly Messaging Webhooks, whenever the customer presses a button the value (payload) that you specify will be sent through the webhook to indicate which button was pressed.

{
    "number": "16044441234",
    "templateName": "my_template_name",
    "language": "en_US",
    "parameters": []
}

Sending a Carousel template message

{
    "number": "<TARGET PHONE NUMBER>",
    "templateName": "carousel_demo_1",
    "language": "en_US",
    "parameters": [
        {
            "name": "card.0.header.image",
            "value": "https://i.ibb.co/yB7pCHD/2025-02-20-16-38.png"
        },
        {
            "name": "card.0.body.0",
            "value": "Yuri"
        },
        {
            "name": "card.0.button.0.urlSuffix",
            "value": "fruits1234"
        },
        {
            "name": "card.1.header.image",
            "value": "https://i.ibb.co/nM0rYxB/2025-02-20-16-38-1.png"
        },
        {
            "name": "card.1.body.0",
            "value": "3-March 2025"
        },
        {
            "name": "card.1.button.0.urlSuffix",
            "value": "fruitcoupons"
        }
    ]
}

Note that to detect carousel button clicks and replies, you need to subscribe to our Webhook API.

Rate Limiting

To ensure fair usage and maintain service stability, we have implemented rate limiting for above APIs. This endpoint is limited to 200 requests per second. If the limit is exceeded, the API will return a 429 Too Many Requests response.

WhatsApp Message template

To see a list of available languages go to

Please see for the available templates and language translations.

The language is specified in language field. To see a list of available languages go to

For supported media types please reference .

To send a Carousel message, first you need to create the template using .

Assuming you want to send the same template created in , you can use the below payload structure:

Please see the instructions for instructions on how to create a WhatsApp message template.

📱
Meta's official documentation.
Meta Business Manager
Meta's official documentation.
Meta's official documentation
here
Carousel template
Carousel template
  • POST/v1/businesses/{businessId}/send/whatsapp_templated_messages
  • 24 hour WhatsApp restriction
  • Select the WhatsApp number you want to send from
  • Template languages
  • Most common languages for templates
  • How to use template parameters
  • Available options for name keys
  • Examples
  • You have a template with one header variable and several body variables
  • You have a template with a header image and multiple body variables
  • You have a template with a header document
  • You have a template with the link button and button has a suffix
  • You have a template with two quick reply buttons
  • Sending a Carousel template message
  • Rate Limiting
  • WhatsApp Message template
post

API to send a WhatsApp templated message to recipient

Authorizations
Path parameters
businessIdstringRequired
Body
senderstringOptional

Optional. Sender WhatsApp number, not required when only 1 WA number is present.

Example: +16501113333
numberstringOptional

WhatsApp number for recipient.

Example: +16502223333
templateNamestringOptional

WhatsApp template name, managed through WhatsApp Cloud API.

Example: bogo_marketing_campaign
languagestringOptional

Optional. WhatsApp template language, managed through WhatsApp Cloud API.

Example: en
campaignNamestringOptional

Optional. Campaign name.

Example: test_campaign_2022-03-12
Responses
200
A successful response.
application/json
201
Successful response containing id of created message.
application/json
default
An unexpected error response.
application/json
post
POST /v1/businesses/{businessId}/send/whatsapp_templated_messages HTTP/1.1
Host: 
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 306

{
  "sender": "+16501113333",
  "number": "+16502223333",
  "templateName": "bogo_marketing_campaign",
  "language": "en",
  "parameters": [
    {
      "name": "body_1 in body text 'Hi, {{1}}!'",
      "value": "Harry",
      "filename": "doc.pdf"
    }
  ],
  "campaignName": "test_campaign_2022-03-12",
  "order": {
    "parentId": "text",
    "strategy": "strategy_unspecified"
  }
}
{
  "id": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
}