Message templates
Templates are pre-approved messages. WhatsApp requires one to start a conversation, or to write to a customer more than 24 hours after their last message. LUMA passes template calls to Meta with your number's access and returns Meta's answer.
Plan: LUMA Elevate or Enterprise. Credits: free (sending a template costs 12 credits, see Send messages).
List templates
GET /v1/{wabaId}/message_templates
| Query parameter | Type | Description |
|---|---|---|
name | string | Only templates whose name matches |
status | string | APPROVED, PENDING, REJECTED, PAUSED or DISABLED |
limit | integer | Templates per page |
after, before | string | Page cursors from paging.cursors in the previous answer |
fields | string | Comma-separated fields to return, for example name,status,language,category,components |
curl 'https://api.itechintl.com/v1/WABA_ID/message_templates?status=APPROVED&limit=20' \
--header 'Authorization: Bearer lm_live_YOUR_API_KEY'
Response 200
{
"message": "Success",
"data": {
"data": [
{
"id": "TEMPLATE_ID",
"name": "order_update",
"status": "APPROVED",
"category": "UTILITY",
"language": "en_US",
"components": [
{ "type": "BODY", "text": "Hello {{1}}, your order {{2}} is on its way." }
]
}
],
"paging": { "cursors": { "before": "CURSOR_BEFORE", "after": "CURSOR_AFTER" } }
}
}
Create a template
POST /v1/{wabaId}/message_templates
curl --request POST 'https://api.itechintl.com/v1/WABA_ID/message_templates' \
--header 'Authorization: Bearer lm_live_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "order_update",
"language": "en_US",
"category": "UTILITY",
"parameter_format": "positional",
"components": [
{ "type": "HEADER", "format": "TEXT", "text": "Order update" },
{
"type": "BODY",
"text": "Hello {{1}}, your order {{2}} is on its way.",
"example": { "body_text": [ [ "Customer 1", "1001" ] ] }
},
{ "type": "FOOTER", "text": "Reply STOP to opt out" },
{
"type": "BUTTONS",
"buttons": [
{ "type": "URL", "text": "Track order", "url": "https://example.com/track/{{1}}", "example": [ "https://example.com/track/1001" ] },
{ "type": "QUICK_REPLY", "text": "Talk to us" }
]
}
]
}'
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Lowercase letters, numbers and underscores |
language | string | yes | Language code, for example en_US, ar |
category | string | yes | MARKETING, UTILITY or AUTHENTICATION |
components | array | yes | HEADER, BODY, FOOTER, BUTTONS (and CAROUSEL), in Meta's template format |
parameter_format | string | no | positional ({{1}}) or named ({{customer_name}}) |
message_send_ttl_seconds | integer | no | How long WhatsApp keeps trying to deliver |
Meta reviews new templates, usually within minutes, sometimes up to 24 hours. You get the result on your webhook
(Template status) and in the list above. Write the example values with sample data only.
Delete a template
DELETE /v1/{wabaId}/message_templates?name=order_update
| Query parameter | Description |
|---|---|
name | Deletes every language of the template with this name |
hsm_id | With name: deletes only the template with this ID (one language) |
Tips
- Category matters: Meta can move a template to
MARKETINGif its text is promotional, which changes the price Meta charges you. - Keep variables meaningful: Meta rejects templates that are mostly variables.
- You can also create and manage templates in the app: Template Management.