Skip to main content

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 parameterTypeDescription
namestringOnly templates whose name matches
statusstringAPPROVED, PENDING, REJECTED, PAUSED or DISABLED
limitintegerTemplates per page
after, beforestringPage cursors from paging.cursors in the previous answer
fieldsstringComma-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" }
]
}
]
}'
FieldTypeRequiredDescription
namestringyesLowercase letters, numbers and underscores
languagestringyesLanguage code, for example en_US, ar
categorystringyesMARKETING, UTILITY or AUTHENTICATION
componentsarrayyesHEADER, BODY, FOOTER, BUTTONS (and CAROUSEL), in Meta's template format
parameter_formatstringnopositional ({{1}}) or named ({{customer_name}})
message_send_ttl_secondsintegernoHow 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 parameterDescription
nameDeletes every language of the template with this name
hsm_idWith name: deletes only the template with this ID (one language)

Tips​

  • Category matters: Meta can move a template to MARKETING if 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.