Skip to main content
Sending template messages is the core functionality of our API. To make integration simple and avoid manual structure building, you do not need to manually design variable mapping objects or lists. Instead, you can dynamically fetch a ready-to-use sample payload skeleton for any template and use it directly.

Dynamic workflow

Follow these two steps to send any template message (including text, media, buttons, and carousels):

Step 1: Fetch the payload skeleton

Send a request to the Fetch Payload Skeleton endpoint to get the exact JSON structure needed for your template:
GET /api/templates/{templateId}/payload-skeleton

Sample response

Depending on the template type, the endpoint returns the corresponding payload structure. For example, a marketing template with header media, body text, and a discount button returns:
{
  "status": "success",
  "data": {
    "templateId": "123e4567-e89b-12d3-a456-426614174000",
    "recipientPhoneNumber": "919999999999",
    "countryCode": "+91",
    "variableMapping": {
      "header": {
        "1": "https://example.com/image.jpg"
      },
      "body": {
        "1": "John Doe"
      },
      "buttons": [
        {
          "type": "copy_code",
          "coupon_code": "SAVE50"
        }
      ]
    }
  }
}

Step 2: Copy, customize, and send

  1. Copy the data object from the response above.
  2. Replace the placeholders (e.g. phone number, image URLs, custom names) with your actual recipient details and variables.
  3. Paste and send the payload to the Send Template Message endpoint (POST /api/templates/external/message/send).

Parameter details

Here are the primary parameters included in the payload skeleton:
ParameterTypeRequiredDescription
templateIdstringYesThe unique UUID of the WhatsApp template.
recipientPhoneNumberstringYesRecipient’s phone number with country code (e.g., 919999999999).
countryCodestringYesCountry code for the phone number (e.g., +91).
variableMappingobjectNoPre-structured variable mapping for header, body, buttons, or carousel fields.