01 · Definition
What is a message template variable?
A message template variable is a placeholder inside an approved WhatsApp template that is replaced with real data each time the template is sent. Meta reviews the fixed wording once; the variables are the slots that let one approved template carry a different name, order number, amount, date or link for every recipient. Positional variables — {{1}}, {{2}}, {{3}} — are the default format.
Variables can sit in three places. The template body takes as many as its length can justify. A text header takes exactly one. A dynamic URL button takes one, and only at the very end of the URL, so just the suffix changes per send. Media headers have no text variable: the image, video or document itself is supplied at send time. Authentication templates are different again — Meta fixes their wording, and the only value you supply is the one-time code.
Placement rules are checked at review: numbering must be sequential from {{1}}, the text cannot start or end with a variable, the placeholders themselves cannot contain characters such as #, $ or %, and a template with too many variables for its length is rejected. Sample values are required for every variable when you submit. At send time the request must supply exactly one value per placeholder, in order — a mismatch fails with error 132000. Templates can instead use descriptive names such as {{first_name}}; that format is covered under named parameters.
Key takeaways
- A message template variable is a placeholder such as {{1}} that your send request fills with per-recipient data in an approved template.
- Variables can sit in the body (several), a text header (one) and a URL button (one, at the very end of the URL); the footer takes none.
- Numbering runs from {{1}} with no gaps, and the text can never start or end with a variable.
- Every variable needs a sample value at submission, and each send must supply exactly one value per placeholder or it fails with error 132000.
- Values change on every send without re-review; only edits to the fixed text, buttons or structure go back to Meta.
02How does InfiQ help with a message template variable?
InfiQ fills template variables per recipient from contact fields in broadcasts, and its free variable checker catches mismatched or missing placeholders before you send.
Template variable checker03 · Specifications
A message template variable: key facts and limits
| Syntax | {{1}}, {{2}}, {{3}} … (positional, the default) |
|---|---|
| Text header | 1 variable, 60 characters max |
| Body | Multiple variables, 1,024 characters max |
| URL button | 1 variable, only at the end of the URL |
| Placement | Sequential; never first or last in the text |
| Wrong value count at send | Error 132000 |
| Values | No new lines, tabs or 5+ consecutive spaces |
04 · Code samples
A message template variable in code
curl -X POST "https://api.infiq.in/v1/messages" \-H "X-INFIQ-API-KEY: {INFIQ_API_KEY}" \-H "Content-Type: application/json" \-d '{"messaging_product": "whatsapp","to": "919812345678","type": "template","template": {"name": "order_shipped","language": { "code": "en" },"components": [{ "type": "header", "parameters": [{ "type": "text", "text": "IQ-50731" }] },{ "type": "body", "parameters": [{ "type": "text", "text": "Rahul" },{ "type": "text", "text": "2" },{ "type": "text", "text": "Monday, 27 October" }] },{ "type": "button", "sub_type": "url", "index": "0","parameters": [{ "type": "text", "text": "IQ-50731" }] }]}}'
One value per placeholder: header {{1}}, body {{1}}–{{3}} in order, and only the suffix for the URL button.
05Playground
A working model of Message Template Variable. Use its controls to replay it step by step.
Follow {{1}} from the template to the send
{ "name": "order_shipped", "language": "en", "category": "UTILITY", "components": [ { "type": "HEADER", "format": "TEXT", "text": "Order {{1}} is on its way", "example": { "header_text": ["IQ-48213"] } }, { "type": "BODY", "text": "Hi {{1}}, your order of {{2}} items left our Pune warehouse and should arrive by {{3}}.", "example": { "body_text": [["Priya", "3", "Friday, 24 October"]] } }, { "type": "BUTTONS", "buttons": [ { "type": "URL", "text": "Track order", "url": "https://shop.example.in/track/{{1}}", "example": ["https://shop.example.in/track/IQ-48213"] } ] } ]}Step 4 of 4 · lines 13–15
A URL button takes one variable, at the very end. Its sample is the whole URL with a realistic suffix.
Template definition, step 4 of 4, lines 13–15: A URL button takes one variable, at the very end. Its sample is the whole URL with a realistic suffix.
06 · Operation
How does a message template variable work?
Write the fixed text first
Draft the message as a customer will read it, then replace only the parts that change per recipient with
{{1}},{{2}}and so on, numbered in the order they appear. The header has its own numbering, starting again at{{1}}.Add a sample for each variable
On submission, give every placeholder a realistic example in
example.body_text,example.header_textor the URL button'sexample, so the reviewer can read the finished message rather than bare placeholders.Pass review
Review checks numbering, placement and the ratio of fixed text to variables alongside policy and category. Approval covers the fixed text and structure, not the values you send later.
Fill the values at send time
In the
/messagesrequest, each component with variables gets aparametersarray: the body lists one text value per placeholder in order, the header one value, and a URL button one suffix addressed by its zero-basedindex.Check the rendered result
WhatsApp substitutes the values and delivers the message. A wrong count fails with error 132000, but values in the wrong order still send — with the name where the date should be — so test with real data before a large send.
07 · Cautions
Common mistakes with a message template variable
Leaving a gap in the numbering
{{1}}followed by{{3}}fails review. Renumber whenever you delete a variable, and keep the numbers in reading order so the send code stays obvious.Starting or ending with a variable
“{{1}}, your order is ready” or a body that finishes on
{{2}}is rejected as a dangling parameter. Put fixed words on both sides: “Hi {{1}}, …” and “… arrives by {{2}}. Track it below.”Writing a template that is mostly placeholders
A body such as “{{1}} {{2}} {{3}}” hides the message from review and is rejected for having too many parameters for its length. Keep enough fixed text around each variable that the purpose is clear from the template alone.
Sending values in the wrong count or order
Too few or too many values fails with error 132000; the right count in the wrong order sends a confusing message. Build the array from one field map in code and assert its length before every send.
Putting line breaks in values
Parameter values with new lines, tabs or long runs of spaces are refused. Keep multi-line layout in the fixed template text and send single-line values.
08 · Worked example: One template, thousands of shipping updates
Example: One template, thousands of shipping updates
A Pune electronics store's order_shipped template has a text header “Order {{1}} is on its way”, the body “Hi {{1}}, your order of {{2}} items left our Pune warehouse and should arrive by {{3}}.” and a Track order button pointing to https://shop.example.in/track/{{1}}. The order system maps the customer's first name, item count and promised date to the body, and the order number to both the header and the button suffix. One approval covers around 4,000 personalised shipping updates a day, and a weekly test send with the longest real names catches layout problems before customers do.
09 · Rationale
Why does a message template variable matter?
Variables are what make templates economical. Without them, every order number or appointment time would need its own approved template; with them, a single order_shipped template can serve every customer for years. They are also the most common reason a correct-looking send fails or a template is rejected — a value missing from the request, numbering with a gap, or a body that is mostly placeholders. Getting the rules right once saves repeated review cycles and failed messages.
10 · Recommended practice
Best practices for a message template variable
- Keep a field map (variable → data source) next to each template so anyone can see what fills
{{2}}. - Send a sensible fallback such as “there” when a first name is missing, never an empty value.
- Format dates, amounts and units the way customers read them before inserting them.
- Fill the header and the URL button from the same source when both show the order number, so they can never disagree.
11 · Questions and answers
Message Template Variable FAQs
- How many variables can a WhatsApp template have?
- Meta does not publish a fixed cap for the body; the limit is the ratio, and too many variables for the message length is a rejection reason. A text header allows one variable and each URL button one.
- Can I change variable values without re-approval?
- Yes. Values change on every send without review. Only edits to the fixed text, buttons or structure go back to Meta.
- Do variables change what a message costs?
- No. Meta charges per delivered message by template category; the number of variables makes no difference to the price.
- Why does my template send fail with error 132000?
- Your request sent a different number of values than the approved template has placeholders. Count the header and body variables separately, send one text parameter per placeholder in each, and give a dynamic URL button its own
buttoncomponent with one suffix. - Can the footer contain a variable?
- No. The footer is fixed text. Values go in the header, the body and URL buttons, plus the code passed to copy-code and authentication buttons.