WhatsApp Template Variables: {{1}} vs Named Parameters
How WhatsApp template variables work: positional {{1}} vs named parameters, where they are allowed, sample values, Meta's rejection rules and a send payload.
By OmniChannels.ai Editorial Team ยท Reviewed by BroadNet Messaging Solutions Team
Short answer
A WhatsApp template variable is a placeholder, written {{1}} in positional templates or {{first_name}} in named templates, that you fill in each time you send. Choose the format with parameter_format when you create the template; positional is the default. Every variable needs a sample value for review. Variables are allowed in the body, in a text header (one) and in a URL button suffix (one), and Meta rejects templates that start or end with a variable.
On this page
- What are WhatsApp template variables?
- What is the difference between positional and named parameters?
- Where are variables allowed?
- How do I provide sample values?
- What does Meta say about variable rules and rejections?
- How do I send the parameters in the API call?
- Worked example: an order-shipped template
- How do I personalise a template from a CSV?
- How do I choose between positional and named?
- What are the common mistakes?
- How OmniChannels.ai helps
Key takeaways
- Positional variables are numbered {{1}}, {{2}} and must be filled in order; named variables use lowercase names with underscores and can be filled in any order.
- A template must include a sample value for every variable when you create it; Meta uses the samples during review.
- A text header supports one variable, the body accepts several, and a URL button supports one variable appended to the end of the URL.
- Meta's documented rejection causes include malformed or non-sequential variables, a template that starts or ends with a variable, too many variables for the text length, and special characters such as #, $ or %.
- Personalisation from a CSV means one row per recipient with a clean value for each variable.
This guide is for developers and marketers who create WhatsApp templates with personalised content. It explains the two variable formats, where variables can go, what Meta says about review, and how to send the values from the API or from a spreadsheet.
What are WhatsApp template variables?
A variable is a placeholder in the template text that you replace with a real value when you send. Meta calls them parameters. WhatsApp Manager calls them variables. The template text and the sample values are reviewed once; the real values are supplied for every message.
For example, a template body reads Hi {{1}}! Your order number is {{2}}. Thank you. and you send Hi Layla! Your order number is OM-4821. Thank you. to one customer and a different pair of values to the next.
Meta does not translate template text or variable values. You supply them in the correct language for each language version of the template.
What is the difference between positional and named parameters?
You choose the format when you create the template with the parameter_format field. If you leave it out, Meta uses positional.
| Positional | Named | |
|---|---|---|
| Placeholder | {{1}}, {{2}} |
{{first_name}}, {{order_number}} |
| Naming rule | Numbered from 1, in order | Unique, lowercase letters and underscores |
| Send values | Must follow placeholder order | Can appear in any order |
| Sample values | body_text array |
body_text_named_params with param_name |
| Best for | Short templates with one or two variables | Templates with several variables that others must maintain |
Named parameters read better in a template library, and a swapped order cannot silently put an order number where a name belongs. Positional templates are shorter to write and remain the default.
Where are variables allowed?
Meta's components documentation lists these places:
| Component | Variables |
|---|---|
| Text header | One parameter |
| Body | Multiple parameters |
| URL button | One variable, appended to the end of the URL |
| Media header (image, video, document) | None; the example asset is supplied at creation and the asset at send |
| Footer, quick reply and phone-number buttons | Not listed as supporting variables |
Documented length limits: a text header up to 60 characters, a body up to 1,024, a footer up to 60, a button label up to 25 and a button URL up to 2,000 characters. If a URL button value contains special characters, Meta says to percent-encode them.
How do I provide sample values?
Meta's rule is that if your template uses variables, you must include sample values when you create it, one for each parameter. A header with a variable needs an example as well.
Positional body with samples:
{
"type": "BODY",
"text": "Hi {{1}}! Your order {{2}} ships on {{3}}.",
"example": { "body_text": [["Layla", "OM-4821", "12 November"]] }
}
Named body with samples:
{
"type": "BODY",
"text": "Hi {{first_name}}! Your order {{order_number}} ships on {{ship_date}}.",
"example": {
"body_text_named_params": [
{ "param_name": "first_name", "example": "Layla" },
{ "param_name": "order_number", "example": "OM-4821" },
{ "param_name": "ship_date", "example": "12 November" }
]
}
}
The template itself sets "parameter_format": "named" for the second form. Use realistic samples so reviewers can see what the real message will say.
What does Meta say about variable rules and rejections?
Meta's template review guidance lists these variable-related reasons for rejection:
- Variables are missing or have mismatched curly braces. The correct positional form is
{{1}}. - Variables are not sequential, for example
{{1}},{{2}},{{5}},{{4}}. - The template starts or ends with a variable. Meta calls these dangling parameters.
- The template has too many variables relative to the message length. Meta gives no ratio, so add fixed text around each variable.
- Variables contain special characters such as
#,$or%.
We did not find an official statement on two variables placed directly next to each other, so we do not give a rule for it. Separate them with words, which also reads better.
For category rules and what else causes a rejection, see WhatsApp template categories and approval. For ready-made wording, see WhatsApp message template examples.
How do I send the parameters in the API call?
You send the template name, the language and a components array with the values. This is the shape for a positional template:
{
"messaging_product": "whatsapp",
"to": "971500000000",
"type": "template",
"template": {
"name": "order_shipped",
"language": { "code": "en" },
"components": [
{ "type": "body", "parameters": [
{ "type": "text", "text": "Layla" },
{ "type": "text", "text": "OM-4821" },
{ "type": "text", "text": "12 November" }
] }
]
}
}
For a named template, each entry also carries parameter_name, which must match the placeholder:
{ "type": "text", "parameter_name": "order_number", "text": "OM-4821" }
How do header media parameters work?
A media header has no text variable. At creation, the header holds an example asset handle from Meta's upload flow, and the example is reviewed with the template. At send time you pass the asset, for example an image by media ID:
{ "type": "header", "parameters": [ { "type": "image", "image": { "id": "1558081531584829" } } ] }
The ID above is the example from Meta's documentation, not a real asset.
How does this look through the OmniChannels.ai API?
Our sendbulk endpoint takes the template as form fields, per the WhatsApp API docs:
| Template feature | Fields |
|---|---|
| Body variable | bodyTemplateVariables |
| Named parameter | bodyTemplateVariables={"parameter_name":"order_id","text":"ORD-12345"} |
| Header text variable | headerTemplateVariables |
| Header image, video or document | mediaUrl (overrides the header media) |
| Dynamic URL button | buttonsTemplateVariable |
Worked example: an order-shipped template
"Souq Rafiq" (synthetic), a UAE retailer, wants a shipping update with a product image and a tracking button.
- Write the template so that it neither starts nor ends with a variable: "Hi {{1}}, your order {{2}} has shipped and should arrive on {{3}}. Tap the button to follow it."
- Add the header as an image, the footer as plain text, and a URL button
https://shop.example/track/{{1}}with a sample such asOM-4821. - Submit with realistic samples for every variable, then wait for the approval status.
- Send with the three body values, the tracking suffix and, if you override it, the header image.
curl -X POST https://api.broadnet.me/whatsapp/message/sendbulk \
-H "Authorization: Bearer $BROADNET_TOKEN" \
-F batchId=0 \
-F campaignName=order-shipped \
-F destinationNo=971500000000 \
-F messageType=TEMPLATE \
-F templateName=order_shipped \
-F templateLanguage=en \
-F bodyTemplateVariables=Layla \
-F buttonsTemplateVariable=OM-4821
This snippet shows the field names for a single value. For several body variables per recipient, use a personalised upload instead of repeating the command. Confirm the encoding with our team for your first campaign.
How do I personalise a template from a CSV?
Use one row per recipient and one column per variable, then upload it in a personalised send.
- Put the recipient's number in international format in the first column. See E.164 phone number format.
- Add one column per variable, and confirm the column layout with our team for your first campaign.
- Clean the data first: trim spaces, fix capitalisation, use one date format, and remove empty values, because an empty variable produces a broken message or a failed send.
- Preview several rows and send to your own number first.
Data-cleaning steps are covered in send bulk SMS from Excel or CSV; they apply equally to WhatsApp.
How do I choose between positional and named?
Pick by how many people will touch the template and how many variables it has.
- One or two variables, one owner: positional is fine and is the default.
- Three or more variables, or several teams editing templates: use named, so each placeholder explains itself.
- Same wording in several languages: keep the same names or numbers across versions, so one send routine can fill every language.
- Always keep a record of which source column feeds which variable, so a later edit to the template does not shift the data.
Before you submit, read the finished message aloud with the sample values. If it sounds unnatural, reviewers and customers will think so too.
What are the common mistakes?
- Starting or ending with a variable, which Meta lists as a rejection reason.
- Skipping numbers or reusing the same number out of order in a positional template.
- Placeholder samples such as "test" that tell reviewers nothing.
- Special characters like
#,$or%inside variables. - Wrong order at send time in a positional template, which puts the right data in the wrong place.
- Mismatched
parameter_namein a named template. - Using a variable to hide the real purpose of the message. A template whose category does not match its content can be rejected or recategorised; see the categories guide.
- Limits: this guide reports what Meta's documentation states at the time of writing. Review decisions stay with Meta and rules change, so check the linked pages.
How OmniChannels.ai helps
BroadNet is an official Meta Business Solution Provider. In OmniChannels.ai you can create WhatsApp templates with variables, media and buttons, preview them and track approval status, then send them with personalised values from the API or from an Excel or CSV upload in a campaign. Duplicate filtering and delivery reports are included. See the WhatsApp Business API page and the campaigns platform.
Frequently asked questions
What is the difference between positional and named parameters?
Positional templates use numbered placeholders such as {{1}} and require the send values in the same order. Named templates use lowercase names with underscores, such as {{order_number}}, and the values can appear in any order in the send payload. If you do not set parameter_format when creating the template, Meta uses positional.
Where can I use variables in a WhatsApp template?
Meta's documentation lists the body, which accepts multiple parameters, a text header, which supports one parameter, and a URL button, which supports one variable appended to the end of the URL. Media headers carry an asset instead of a variable. Footers, quick-reply buttons and phone-number buttons are not listed as supporting variables.
Why was my template rejected for variables?
Meta's review guidance lists several variable-related causes: missing or mismatched curly braces, variables that are not sequential, a message that starts or ends with a variable, too many variables relative to the message length, and special characters such as #, $ or %. Fix the text, add realistic samples and resubmit.
Do I need sample values?
Yes. Meta says that if a template uses variables, you must include sample values when you create it, one for each parameter. Use realistic values, not placeholders such as test, so reviewers can see how the final message will read. Samples are used for review only; real values are supplied at send time.
Can a variable contain a line break or a link?
This guide only covers what we verified in Meta's documentation, and the pages we checked do not state a rule for line breaks inside variable values. Test with a real send to your own number, and ask our team if you plan to pass long or formatted values. A URL button value is appended to the end of the button URL.
How do I personalise a template from a spreadsheet?
Keep one row per recipient and one column for each variable, with clean values: names without stray spaces, dates in one format, numbers in international format. Upload the file when you send a personalised campaign and check the preview. Confirm the exact column layout with our team before your first campaign.
Sources
Keep reading
More guidesWhatsApp
Best WhatsApp Business API Provider in Canada
Choosing the best WhatsApp Business API provider in Canada: app vs API, a vendor-neutral checklist, CASL and privacy rules, fr_CA templates and SMS fallback.
9 min read
WhatsApp
Best WhatsApp Business API Provider in Chile (Santiago)
Best WhatsApp Business API provider in Chile (Santiago): app vs API, a vendor-neutral checklist, Law 19.496 and 21.719, es_CL templates and SMS fallback.
9 min read
Integration
E.164 Phone Number Format: How to Convert and Validate
E.164 phone number format explained: the rules, how to convert local numbers with a table of examples, WhatsApp and SMS API needs, regex and libphonenumber.
9 min read
