Documentation

Message Templates

Create and manage WhatsApp Business message templates via the Chatbase API

Message Templates

WhatsApp requires pre-approved templates for proactive messages sent outside the 24-hour customer service window. Templates are reviewed by Meta before use.


Template Categories

CategoryUse CasePricing
MarketingPromotions, offers, re-engagementHigher cost
UtilityOrder confirmations, shipping updates, OTPsStandard
AuthenticationLogin codes, 2FA verificationStandard

List Templates

Retrieve all approved templates for your WhatsApp Business account:

GET /templates
curl https://chatbase.in/api/v1/whatsapp/templates \
  -H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response:

{
  "success": true,
  "templates": [
    {
      "id": "1234567890",
      "name": "order_shipped",
      "status": "APPROVED",
      "category": "UTILITY",
      "language": "en_US",
      "components": [
        {
          "type": "BODY",
          "text": "Your order {{1}} has been shipped! Expected delivery in {{2}} days."
        }
      ]
    }
  ]
}

Create a Template (via Dashboard)

Templates must be created from the CRM dashboard → Manage Template and submitted to Meta for approval. Approval typically takes a few minutes to 24 hours.

Template Structure

A template consists of optional header, required body, optional footer, and optional buttons.

{
  "name": "order_shipped",
  "category": "UTILITY",
  "language": "en_US",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Order Update"
    },
    {
      "type": "BODY",
      "text": "Hi {{1}}, your order {{2}} has been shipped and will arrive in {{3}} days."
    },
    {
      "type": "FOOTER",
      "text": "Chatbase — WhatsApp CRM"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        { "type": "URL", "text": "Track Order", "url": "https://track.example.com/{{1}}" }
      ]
    }
  ]
}

Using Variables in Templates

Variables are placeholders in the format {{1}}, {{2}} etc. When sending, pass values in the components.parameters array:

{
  "to": "919876543210",
  "type": "template",
  "template": {
    "name": "order_shipped",
    "language": { "code": "en_US" },
    "components": [
      {
        "type": "body",
        "parameters": [
          { "type": "text", "text": "Rahul" },
          { "type": "text", "text": "ORD-98765" },
          { "type": "text", "text": "2" }
        ]
      }
    ]
  }
}

Authentication / OTP Template

Send a one-time password using the dedicated OTP endpoint:

POST /messages/send/authentication/utility

Credit-driven: consumes one utility message credit per OTP (no separate OTP feature). Requires the Third-Party API add-on for API access.

curl -X POST https://chatbase.in/api/v1/whatsapp/messages/send/authentication/utility \
  -H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "919876543210",
    "otp": "482931",
    "expiryMinutes": 10
  }'

Verify OTP

POST /otp/verify
curl -X POST https://chatbase.in/api/v1/whatsapp/otp/verify \
  -H "Authorization: Bearer wpapi_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "919876543210",
    "otp": "482931"
  }'

Template Status Values

StatusDescription
APPROVEDReady to use in messages
PENDINGUnder review by Meta
REJECTEDRejected — review the template and resubmit
FLAGGEDFlagged for quality issues — messaging paused
DISABLEDDisabled by Meta due to low quality score

Best Practices

  • Keep template messages clear and relevant — high opt-out rates lead to template disabling
  • Use Utility category for transactional messages (lower rejection rate than Marketing)
  • Always include an opt-out button on marketing templates
  • Test templates with the Test Message feature in the CRM dashboard before going live