# WhatsApp template variables: positional and named parameters

> How WhatsApp template variables work: parameter_format named vs positional, example values at creation, send payloads, rejection rules and 132000 errors.

Published 2026-11-03. Z-API Omni team.

A WhatsApp template uses positional variables such as `{{1}}` unless you create it with `"parameter_format": "named"`, which allows variables such as `{{first_name}}`. Meta's templates overview says, "If you do not specify a format, the template uses `positional` format by default" ([Meta template fundamentals, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview)). Either way, every variable needs an example value at creation, and every send must fill all of them. A missing value returns error 132000. A value in the wrong format returns 132012.

## Positional and named formats

You choose the format when you create the template. The value of `parameter_format` is "either `named` or `positional`", one value per template.

Positional parameters "must be ordered array index numbers, starting from 1, wrapped in double curly brackets". Their values must arrive in the order their placeholders appear in the component text. Swap two values and the customer reads the order number where their name should be.

Named parameters "must be unique, single strings, composed of lowercase characters and underscores", also inside double curly brackets. `{{first_name}}` passes; `{{FirstName}}` and `{{first-name}}` break that rule. Order stops mattering, since "Example values in template creation payloads and real values in template send payloads can appear in any order."

Meta's overview doesn't say whether one template can mix the two formats, or whether you can change `parameter_format` after approval. Treat a format change as a new template.

## Which components take variables

| Component | Variables | Length limit |
|---|---|---|
| Text header | 1 parameter | 60 characters |
| Body | Multiple parameters | 1,024 characters |
| Footer | None listed | 60 characters |
| URL button | 1 variable, appended to the end of the URL | 2,000-character URL |
| Copy code button | Not stated | Example value up to 20 characters; one button per template |
| Button label | None listed | 25 characters |

Source: [Meta template components, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/components). The pages we read give no maximum number of body parameters and no maximum length for a parameter value.

## Create a template with named parameters

Every variable needs an example. Meta's overview says "you must include an example value for each parameter," and the review page repeats it. The call below uses Meta's named sample as the body. The version and shell variables are ours, and `WABA_ID` is your WhatsApp Business Account ID.

```bash
curl "https://graph.facebook.com/v26.0/$WABA_ID/message_templates" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "order_confirmation",
    "language": "en_US",
    "category": "utility",
    "parameter_format": "named",
    "components": [
      {
        "type": "body",
        "text": "Thank you, {{first_name}}! Your order number is {{order_number}}.",
        "example": {
          "body_text_named_params": [
            { "param_name": "first_name", "example": "Pablo" },
            { "param_name": "order_number", "example": "860198-230332" }
          ]
        }
      }
    ]
  }'
```

The positional version of the same template uses `"parameter_format": "positional"` and the text "Hi {{1}}! Your order number is {{2}}. Thank you." The example shape changes with both the format and the component.

| Component | Positional example | Named example |
|---|---|---|
| Body | `"body_text": [["Pablo", "860198-230332"]]`, an array of arrays | `"body_text_named_params": [{"param_name": "...", "example": "..."}]` |
| Text header | `"header_text": ["..."]`, a flat array | `"header_text_named_params": [{"param_name": "...", "example": "..."}]` |
| URL button | `"example": ["summer2023"]` with `{{1}}` at the end of `url` | Meta shows no sample |

Meta's URL button example is `https://www.luckyshrub.com/shop?promo={{1}}`. Every button sample on the components page stays positional, and Meta doesn't say whether a named variable works in a button URL.

## Send values for body, header and button variables

At send time, each variable becomes an object in the component's `parameters` array. For a named template, add `parameter_name` to each object. Meta's utility templates page defines it as the "Name of parameter as defined in the template body component text string" ([Meta utility templates, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/utility-templates/utility-templates)). Meta's samples always include it for named templates, though no rule on the page says it is required. Meta's overview shows this send body without an endpoint, so the curl wrapper and version are ours.

```bash
curl "https://graph.facebook.com/v26.0/$PHONE_NUMBER_ID/messages" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "+16505551234",
    "type": "template",
    "template": {
      "name": "order_confirmation",
      "language": { "code": "en_US" },
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "parameter_name": "first_name", "text": "Jessica" },
            { "type": "text", "parameter_name": "order_number", "text": "SKBUP2-4CPIG9" }
          ]
        }
      ]
    }
  }'
```

For a positional template, drop `parameter_name` and keep the objects in placeholder order. A media header goes in its own component. Meta's utility sample sends `{"type": "header", "parameters": [{"type": "image", "image": {"id": "2871834006348767"}}]}` ahead of a body with four named parameters.

Button variables go in a component of type `button` with a `sub_type` and an `index`. The only button send Meta shows on these pages is the copy-code authentication template. A copy-code button defined as `OTP` becomes type `URL` after creation, so the send uses `sub_type: "url"`. The code appears twice, once in the body and once in the button. This is Meta's sample with the indentation cleaned up and shell variables in place of the token and IDs ([Meta copy code authentication templates, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/authentication-templates/copy-code-button-authentication-templates)).

```bash
curl -L "https://graph.facebook.com/v26.0/$PHONE_NUMBER_ID/messages" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "12015553931",
    "type": "template",
    "template": {
      "name": "verification_code",
      "language": { "code": "en_US" },
      "components": [
        {
          "type": "body",
          "parameters": [{ "type": "text", "text": "J$FpnYnP" }]
        },
        {
          "type": "button",
          "sub_type": "url",
          "index": "0",
          "parameters": [{ "type": "text", "text": "J$FpnYnP" }]
        }
      ]
    }
  }'
```

In Meta's sample, `index` is a string, `"0"`. The [authentication templates guide](/academy/articles/whatsapp-authentication-templates-otp-copy-code/) covers the rest of that flow. Meta doesn't show a URL-button send for a marketing template on the pages we read.

## Variable rules that get a template rejected

Meta's template review page lists five variable problems that lead to rejection ([Meta template review, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/template-review)).

1. "The message template cannot start or end with a parameter (dangling parameters are not allowed)."
2. "Variable parameters are not sequential."
3. "Variable parameters are missing or have mismatched curly braces."
4. "Variable parameters contain special characters such as a `#`, `$`, or `%`."
5. "The template contains too many variable parameters relative to the message length."

Meta gives no ratio for the last rule, so keep fixed text around each variable. None of the template pages we read mentions two variables side by side, such as `{{1}}{{2}}`. If you appeal a rejection, "appeals must include a sample." For other rejection causes, see [why WhatsApp templates get rejected](/academy/articles/whatsapp-template-rejected-common-reasons/).

## Errors for parameter mismatches

| Code | Meta's description | Fix |
|---|---|---|
| 132000 | "The number of variable parameter values included in the request did not match the number of variable parameters" in the template | Send a value for every variable |
| 132012 | "Variable parameter values formatted incorrectly." | Use the format the template was created with |
| 132001 | "The template does not exist in the specified language or the template has not been approved." | Check name, language code and status |
| 131008 | "The request is missing a required parameter." | Add the missing field |
| 131009 | "One or more parameter values are invalid." | Check each value |
| 100 | "The request included one or more unsupported or misspelled parameters." | Check field names |

Source: [Meta error codes, accessed 2026-11-03](https://developers.facebook.com/documentation/business-messaging/whatsapp/support/error-codes). Meta's table also lists 132018, "Template validation error", but only for the Marketing Messages API, with HTTP 400. It doesn't say which code a wrong `parameter_name` returns, so log the full error body when a named send fails.

Count the variables in the approved template and compare that with the length of each `parameters` array before you send. That check catches 132000 in your code instead of in Meta's response. The [Cloud API error codes reference](/academy/articles/whatsapp-cloud-api-error-codes-reference/) covers the remaining template codes, and [error 131047](/academy/articles/whatsapp-error-131047-24-hour-window-templates/) explains when a template is required at all.

*Z-API Omni team*
