Engineering
WhatsApp error 132012 (parameter format mismatch): send each value in the shape the template expects
Why the Cloud API rejects a template send with 132012 when the count of values is right but their shape is wrong: named vs positional variables, header types, currency objects, and reading the live template first.
By Broadchat teamPublished 6 min read
In short
WhatsApp error 132012 means "Variable parameter values formatted incorrectly": you sent the right template, but at least one value is not in the format the template defines. The usual culprits are named variables sent as numbered ones (or the reverse), a text parameter where the header expects an image or document, and malformed currency or date objects. Fetch the template definition, build each parameter to match its component, and test on one number.
Key takeaways
- 132012 is about the shape of a value, not the number of values; a count mismatch is 132000 instead.
- Templates created with named variables such as {{first_name}} need parameter_name on every body parameter; numbered templates must not use it.
- A media header needs an image, video or document parameter of the same type as the template header, never a text parameter.
- Read the template from the API (components and parameter_format) before you hard-code a payload, especially after someone edits the template.
- Meta returns 132012 with HTTP 400 at send time, so nothing was sent and a retry without a change fails the same way.
WhatsApp error 132012 means a template message was refused because one or more variable values are in the wrong format. Meta's error reference says: "Variable parameter values formatted incorrectly. The variable parameter values included in the request are not using the format specified in the template." It returns HTTP 400 Bad Request, so the message never left Meta and was not charged. The fix is always in the request body: compare each parameter you send with the component it fills.
How 132012 differs from its neighbours
Three template errors look alike in a log. Telling them apart saves an hour:
| Code | What is wrong | Example |
|---|---|---|
| 132000 | How many values you sent | Two body values for a body with three variables |
| 132012 | The format of a value | A text parameter sent for an image header, or numbered values for a named template |
| 131008 | A required field of the request is missing | No language object in the template block |
If the count is right and the request is complete, 132012 is the one left: the value exists but has the wrong shape.
The causes we see most
Meta does not publish a list of every mismatch that produces 132012, so treat these as the first things to check, in this order:
- Named versus positional variables. Templates can be created with
parameter_formatNAMED ({{order_id}}) or POSITIONAL ({{1}}). A named template needs"parameter_name": "order_id"on each body parameter. Sending plain positional values to it, or names to a numbered template, is a format mismatch. - The wrong parameter type for a header. The template's header is IMAGE but the call sends
{"type": "text"}, or the header is DOCUMENT and the call sends animageobject because a developer copied the payload from another template. - Malformed currency or date objects. A
currencyparameter needsfallback_value,code(for exampleINR) andamount_1000as an integer (₹1,499.00 becomes1499000). Sending"amount_1000": "1,499"as a string breaks the format. - A template that changed under you. Someone edited the approved template and turned a text header into an image header, or switched it to named variables. The old payload in your code is now wrong.
- Button parameters in the wrong form. A dynamic URL button takes one
textparameter with the suffix only, in abuttoncomponent withsub_typeandindex.
What the error looks like
Illustrative synchronous response (the message wording and details vary between versions):
{
"error": {
"message": "(#132012) Parameter format does not match format in the created template",
"type": "OAuthException",
"code": 132012,
"error_data": {
"messaging_product": "whatsapp",
"details": "header: Format mismatch, expected IMAGE, received UNKNOWN"
},
"fbtrace_id": "AqT7mR2xLw9KcB4nVpE1sZd"
}
}Read error_data.details first. When it names a component (header, body, button), you know where to look.
Step-by-step fix
- Fetch the live template, not the copy in your code:
GET /<WABA_ID>/message_templates?name=order_dispatched&fields=name,language,status,parameter_format,components - Note the header format (TEXT, IMAGE, VIDEO, DOCUMENT or LOCATION) and whether the body uses names or numbers.
- Build one parameter per variable in the matching shape. For a named body:
{
"type": "body",
"parameters": [
{ "type": "text", "parameter_name": "customer_name", "text": "Meera" },
{ "type": "text", "parameter_name": "order_id", "text": "RH-48213" }
]
}- Match the header type exactly. An IMAGE header gets
{"type": "image", "image": {"link": "https://…"}}or an uploaded mediaid; a DOCUMENT header gets adocumentobject, ideally with afilename. - Send to your own number and confirm delivery before the batch.
- Pin the template version in your code. Store the template's components alongside the payload builder and refresh them after every edit in WhatsApp Manager.
A worked example
Meera handles operations at Rangoli Home in Jaipur. Their developer, Arjun, wrote an order-dispatch integration months ago for the template order_dispatched, which then had a text header and numbered variables. Last week the marketing team recreated it in WhatsApp Manager with an image header showing the parcel and named variables {{customer_name}} and {{order_id}}. From the next morning every dispatch message fails with 132012.
Arjun fetches the template, sees parameter_format: NAMED and an IMAGE header, and changes two things: he adds parameter_name to both body values and replaces the text header parameter with an image link to the brand's parcel photo. A test to his own phone delivers, and the backlog of 340 dispatch notices (illustrative) goes out within the hour. He also adds a check that compares the stored components with the live template once a day.
Preventing 132012
- Generate payloads from the template definition, not from a hand-written example.
- Agree on a change process. Editing a template that an integration uses should come with a note to whoever owns the code.
- Validate types before sending: integers for
amount_1000, ISO-style values for dates, HTTPS links for media. - Log the full error, including
details, so the first failure tells you which component broke.
How Broadchat builds template parameters
When you send a template from Campaigns, the Inbox or a chatbot step, Broadchat builds the components from the synced template: a media header gets an image, video or document parameter of the template's own type (a document always carries a file name), a text header gets a text parameter only when its header text has a variable, and templates created with named variables get parameter_name on each body value. A template with a media header cannot be launched until you upload the file or paste its URL. If Meta still rejects a send, message info shows "A template variable is in the wrong format." with code 132012. After someone edits a template in WhatsApp Manager, use Sync Templates in CRM → WhatsApp Templates so the panel works from the current version. Calls your own code makes through the channel API are checked only by Meta.
For the other codes, see the WhatsApp API error codes cheat-sheet, and for how variables, headers and buttons fit together, the message templates guide.
Sources
- WhatsApp error codes — Meta for Developers, checked 1 November 2026
- Template components reference — Meta for Developers, checked 1 November 2026
- Send message templates — Meta for Developers, checked 1 November 2026
Broadchat team · Product and partner success team
The people who build and support Broadchat, the white-label WhatsApp Business API platform. We write from what we see while onboarding partners and their clients on the official WhatsApp Cloud API, and we check every article against Meta's current documentation.
Last updated:
Frequently asked questions
What does WhatsApp error 132012 mean?
It means at least one variable value in your template message is not in the format the template defines, for example a text value where the header expects an image, or numbered values for a template that uses named variables. Fix the request body and resend.
Is 132012 the same as 132000?
No. 132000 means the number of values does not match the number of variables. 132012 means the count may be right but a value has the wrong shape or type. Check the count first, then the format of each value.
How do I send named variables like {{first_name}} through the API?
Give every body parameter a parameter_name equal to the variable name, for example {"type": "text", "parameter_name": "first_name", "text": "Priya"}. Numbered templates must not include parameter_name.
Am I charged for messages that fail with 132012?
No. The API refuses the request with HTTP 400 before anything is sent, and Meta charges only for delivered messages. Nothing reaches the customer either, so fix the payload rather than retrying.
Why did my integration start failing with 132012 without any code change?
Usually because the template itself changed: someone recreated it with a different header type or switched it to named variables. Fetch the template's current components and parameter_format and update the payload to match.