Skip to main content

Templates

Templates are WhatsApp's pre-approved message formats. A message can only be sent outside a customer service window if it uses an approved template.

GET /v1/templates​

Scope: templates:read

curl https://api.msgpanda.com/v1/templates -H "Authorization: Bearer $API_KEY"
{
"templates": [
{
"id": "2c0a8c9d-dcbf-42b1-b0eb-0c05fe619599",
"name": "order_update",
"language": "en",
"category": "utility",
"status": "approved",
"meta_id": "1234567890",
"rejected_reason": "",
"components": [
{ "type": "BODY", "text": "Hi {{1}}, your order {{2}} is out for delivery." }
],
"created_at": "2026-11-04T21:10:00+05:30"
}
]
}
StatusMeaning
draftCreated locally, not submitted
pendingSubmitted, awaiting Meta review
approvedUsable in sends
rejectedSee rejected_reason; edit and resubmit

POST /v1/templates​

Scope: templates:write

curl -X POST https://api.msgpanda.com/v1/templates \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "order_update",
"language": "en",
"category": "utility",
"components": [
{ "type": "HEADER", "format": "TEXT", "text": "Order update" },
{ "type": "BODY", "text": "Hi {{1}}, your order {{2}} is out for delivery.",
"example": { "body_text": [["Ravi", "A-102"]] } },
{ "type": "FOOTER", "text": "MSG Panda" }
]
}'
{ "id": "…", "status": "draft" }

Components​

ComponentRequiredLimits
BODYyes1,024 characters; variables {{1}}… need example.body_text
HEADERnoTEXT max 60 characters and at most one variable, or IMAGE / VIDEO / DOCUMENT with an example.header_handle
FOOTERno60 characters, no variables
BUTTONSnoat most 10 total: 3 quick reply, 2 URL, 1 phone, 1 copy code. Labels 25 characters (copy code 15). URL buttons need url; phone buttons need phone_number.
{
"type": "BUTTONS",
"buttons": [
{ "type": "QUICK_REPLY", "text": "Confirm" },
{ "type": "URL", "text": "Track package", "url": "https://example.com/track/{{1}}" },
{ "type": "PHONE_NUMBER", "text": "Call support", "phone_number": "+911234567890" }
]
}

Requests that break these rules are rejected before reaching Meta, with a validation_failed code and the specific rule in the message.

Media headers​

A IMAGE / VIDEO / DOCUMENT header needs an asset at send time: pass a header parameter in template.components when you call POST /v1/messages.

Rules Meta enforces on top​

  • name: lowercase letters, digits and underscores, max 512.
  • category: utility, marketing or authentication.
  • Every variable ({{1}}) needs an example value or review fails.
  • Utility must describe a transaction the user started; promotional utility is rejected.

POST /v1/templates/{id}/submit​

Scope: templates:write

Sends the draft to Meta for review.

curl -X POST https://api.msgpanda.com/v1/templates/$TEMPLATE_ID/submit \
-H "Authorization: Bearer $API_KEY"
{ "id": "…", "status": "pending" }

Review usually takes minutes. Poll GET /v1/templates until status changes, or watch the dashboard.