Skip to content
Send templates

Send templates with named parameters

By default, template parameters are positional — the first { type: "text" } fills {{1}}, the second fills {{2}}, and so on. Templates approved on Meta v18+ can use named parameters instead, which are more robust to template edits and easier to audit.

A template body approved with named parameters looks like:

Halo {{customer_name}}, pesanan {{order_id}} sudah dikirim.

You then send it with parameter_name fields:

Terminal window
curl -X POST \
https://api.kirimdev.com/v1/$PHONE_ID/messages \
-H "Authorization: Bearer $KIRIM_KEY" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "+628123456789",
"type": "template",
"template": {
"name": "order_shipped_v2",
"language": "id",
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"parameter_name": "customer_name",
"text": "Andi"
},
{
"type": "text",
"parameter_name": "order_id",
"text": "INV-4521"
}
]
}
]
}
}'
ReasonDetail
Resilient to re-orderingIf you swap {{1}} and {{2}} during template re-approval, named params still resolve correctly
Self-documenting codeReading the request body, you see what each value means without referring back to the template body
Required by Meta v18+ for utility templatesSome newer template categories only accept named parameters

You cannot mix the two styles within the same template — Meta picks the style at approval time. Inspect a template via GET /v1/{phone_number_id}/templates/{name} to see whether its parameters are positional or named.