Skip to content

Templates step by step

This guide explains how to structure a WhatsApp template using the BSP API, from basic components to buttons and variables.

Template structure

A template is made up of up to one HEADER, a BODY (required), a FOOTER and a BUTTONS component:

ComponentRequiredMax
HEADERNo1
BODYYes1
FOOTERNo1
BUTTONSNo1 (up to 10 buttons)

Categories

CategoryUsage
MARKETINGPromotions, offers, announcements
UTILITYOrder confirmations, receipts, notifications
AUTHENTICATIONOTP codes, verification
AUTHENTICATION templates can only send OTP and do not allow URLs, media or emojis. Their parameters are limited to 15 characters.

Basic example: text with variable

{
  "name": "welcome_message",
  "language": "es",
  "category": "MARKETING",
  "components": [
    {
      "type": "BODY",
      "text": "¡Hola {{1}}! Welcome to Chattigo.",
      "example": {
        "body_text": [["Juan"]]
      }
    }
  ]
}
Every variable ({{1}}, {{name}}) requires the example field with sample values. Without it, Meta rejects the template.

Parameter formats

FormatSyntaxExample
positional (default){{1}}, {{2}}"example": {"body_text": [["val1", "val2"]]}
named{{first_name}}"example": {"body_text_named_params": [{"param_name": "first_name", "example": "Pablo"}]}

Full example: header + body + footer + buttons

{
  "name": "order_status",
  "language": "es",
  "category": "UTILITY",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Your order {{1}}",
      "example": { "header_text": ["#12345"] }
    },
    {
      "type": "BODY",
      "text": "Your order was shipped and will arrive on {{1}}.",
      "example": { "body_text": [["Friday 20th"]]
      }
    },
    { "type": "FOOTER", "text": "Thank you for shopping at Chattigo Store." },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "URL",
          "text": "Track order",
          "url": "https://store.example.com/track/{{1}}",
          "example": ["12345"]
        }
      ]
    }
  ]
}

Button types

TypeMaxNotes
QUICK_REPLY10Max 25 characters of text
URL2Max 2000 characters of URL
PHONE_NUMBER1Max 20 characters of phone
COPY_CODE1Requires example with the code
VOICE_CALL1
OTP1AUTHENTICATION only, with otp_type
MPM1Multi-product, with catalog
SPM1Single product
FLOW1WhatsApp Flows
CATALOG1Product catalog
REQUEST_CONTACT_INFO1Requests the user’s number, no text or example
QUICK_REPLY buttons must be grouped together, not interleaved with other types. For example, [URL, PHONE, QR, QR] is valid; [QR, URL, QR] is not.

Text limits

ComponentMax
HEADER TEXT60 characters
BODY1024 characters
FOOTER60 characters
Template name512 characters (lowercase + underscore)

Pre-create checklist

  1. The category matches the message content.
  2. The language code is valid (es, en_US, pt_BR…).
  3. The name uses lowercase, alphanumeric and underscores.
  4. The BODY is present and does not exceed 1024 characters.
  5. Every variable has its example field populated.
  6. URL buttons with variables have example populated.
  7. COPY_CODE has example with the code.
  8. Media header: the handler was already uploaded (example.header_handle).
  9. No QUICK_REPLY mixed with other types in the same group.