Create New WhatsApp Template

Easily create WhatsApp message templates with the DoubleTick API, ensuring seamless and compliant customer communication. ✨📩

API Endpoint

Use the following endpoint to create a new WhatsApp message template:

POST https://public.doubletick.io/template

Request Headers

{
  "Authorization": "YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request Body Parameters

Standard Template Request Body

{
  "language": "en",
  "components": {
    "header": {
      "format": "TEXT",
      "text": "Header text"
    },
    "body": {
      "text": "Body Text"
    },
    "footer": {
      "text": "Footer Text"
    },
    "buttons": [
      {
        "type": "URL",
        "text": "Create New Template",
        "url": "https://your-file-url/file.jpg"
      }
    ]
  },
  "category": "UTILITY",
  "allowCategoryUpdate": true,
  "name": "your_template_name",
  "wabaNumbers": [
    "sender_number"
  ]
}

Carousel Template Request Body

{
  "language": "en",
  "components": {
    "body": {
      "text": "Check out our latest products"
    },
    "carousel": {
      "cards": [
        {
          "components": [
            {
              "header": {
                "format": "IMAGE",
                "example": {
                  "link": "https://example.com/product-1.jpg"
                }
              },
              "body": {
                "text": "Product 1"
              },
              "buttons": [
                {
                  "type": "URL",
                  "text": "View Product",
                  "url": "https://example.com/product-1"
                }
              ]
            }
          ]
        },
        {
          "components": [
            {
              "header": {
                "format": "IMAGE",
                "example": {
                  "link": "https://example.com/product-2.jpg"
                }
              },
              "body": {
                "text": "Product 2"
              },
              "buttons": [
                {
                  "type": "URL",
                  "text": "View Product",
                  "url": "https://example.com/product-2"
                }
              ]
            }
          ]
        }
      ]
    }
  },
  "category": "MARKETING",
  "allowCategoryUpdate": true,
  "name": "your_carousel_template_name",
  "wabaNumbers": [
    "sender_number"
  ]
}

Parameters

  • language (string, required): The language of the template.
  • components (object, required): The structure of the template, including header, body, footer, buttons and carousel.
  • carousel (object, optional): Only for MARKETING category. Send it with body; header, footer and buttons are not allowed at the top level.
    • cards (array of objects, required): 1 to 10 cards.
      • components (array, required): Array with one object containing the card's header, body and buttons.
        • header (object, required)
          • format (string, required): IMAGE or VIDEO. Must be the same for every card.
          • example.link (string, required): Public URL of the card's image or video.
        • body (object, optional)
          • text (string, required): Length not exceed 160 characters.
        • buttons (array of objects, required): 1 to 2 buttons (QUICK_REPLY, URL, PHONE_NUMBER). Every card must have the same button types in the same order.
  • header (object, optional): Can include text or media (image, video, document).
    • format (string, required): Header format (TEXT, IMAGE, VIDEO, DOCUMENT)
    • text (string, optional)
      • Length not exceed 60 characters.
  • body (object, required)
    • text (string, required)
      • Main text content with placeholders if needed.
      • Length not exceed 1024 characters.
  • footer (object, optional)
    • text (string, required)
      • Length not exceed 60 characters.
  • buttons (array of objects, optional)
    • type (string, required): List of interactive buttons (QUICK_REPLY, URL, PHONE_NUMBER).
    • text (string, required): Length to be in between 1 to 25 characters.
    • url (string, optional): Required if type selected as URL
    • phoneNumber (string, optional): Required if type selected as PHONE_NUMBER
  • category (string, required): Template category (UTILITY, MARKETING).
  • allowCategoryUpdate (boolean, optional): Allows Meta to auto-assign a category (default: true).
  • name (string, required):
    • Unique name for the template.
    • Length to be in between 1 to 512 characters.
  • wabaNumbers (array of strings, required): List of WhatsApp Business API numbers registered for messaging.

Response

Success Response (201)

{
  "success": true
}

Bad Request (400)

{
  "message": "error_message",
  "error": "Bad Request",
  "statusCode": 400
}

Unauthorized (401)

{
  "message": "Invalid public api key",
  "error": "Unauthorized",
  "statusCode": 401
}

Unprocessable Entity (422)

{
  "message": "invalid file type for audio: text/html; charset=utf-8",
  "error": "Unprocessable Entity",
  "statusCode": 422
}

Best Practices

  • Choose a clear, descriptive template name.
  • Use placeholders wisely for personalization.
  • Follow WhatsApp's Business Messaging Policy to avoid rejection.

What’s Next

Explore more message types and enhance your WhatsApp communication with DoubleTick API

Did this page help you?