How to send a WhatsApp template message with the API
A template message is how a business starts a WhatsApp conversation, or restarts one after the 24-hour window has closed. You create the template once, Meta reviews it, and from then on each send names the template, its language and the values for its variables. This guide shows the JSON for each common template shape, sent through InfiQ's API.
In short
Send type template with template.name, template.language.code and a components array that fills the variables: a body component with text parameters, a header component for an image, video or document, and button components for quick replies, URLs and copy codes. The name and language code must match an approved template exactly, and the number of parameters must match its placeholders.When a template is required
Use a template for any message you send first and for anything sent more than 24 hours after the customer's last message. Each template belongs to a category, and Meta charges per delivered message by category: in India ₹0.94 for marketing, ₹0.19 for utility and ₹0.14 for authentication. Marketing templates also need the customer's opt-in.
Send a template with no variables
The smallest template send names the template and its language. hello_world is the sample template Meta adds to new accounts, approved in en_US:
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": "919820000001","type": "template","template": {"name": "hello_world","language": {"code": "en_US"}}}'
Fill the body variables
A template with placeholders takes a body component with one parameter per placeholder, in order. If the template was created with named parameters, such as customer_name and order_id, pass parameter_name with each value instead, and the order no longer matters. Currency and date values have their own parameter types with a fallback text.
{"messaging_product": "whatsapp","to": "919820000001","type": "template","template": {"name": "order_confirmation","language": {"code": "en"},"components": [{"type": "body","parameters": [{"type": "text","text": "Ananya"},{"type": "text","text": "INF-3091"}]}]}}
Add a media header
If the template has an image, video or document header, send the file with each message as a header parameter. The link must be a public HTTPS URL that WhatsApp can download; a link it can't fetch fails with error 131052. For documents, filename sets the name the customer sees.
{"messaging_product": "whatsapp","to": "919820000001","type": "template","template": {"name": "shipment_update","language": {"code": "en"},"components": [{"type": "header","parameters": [{"type": "image","image": {"link": "https://www.infiq.in/media/box.jpg"}}]},{"type": "body","parameters": [{"type": "text","text": "INF-3091"}]}]}}
Fill the buttons: quick replies, URLs and copy codes
Button components are addressed by sub_type and index, the button's position in the template counted from 0. Quick-reply buttons take a payload that comes back to you when the customer taps; dynamic URL buttons take the text added to the end of the URL; copy-code buttons take the coupon code.
{"messaging_product": "whatsapp","to": "919820000001","type": "template","template": {"name": "reorder_prompt","language": {"code": "en"},"components": [{"type": "body","parameters": [{"type": "text","text": "Ananya"}]},{"type": "button","sub_type": "quick_reply","index": "0","parameters": [{"type": "payload","payload": "REORDER_INF3091"}]},{"type": "button","sub_type": "quick_reply","index": "1","parameters": [{"type": "payload","payload": "STOP_PROMOS"}]}]}}
Fix the errors people hit first
Most failed template sends come down to one of these:
- 132001, template name does not exist in the translation: the name or the language code doesn't match an approved template. en and en_US are different languages to WhatsApp, so send the exact code the template was approved in.
- 132000, number of parameters doesn't match: the template expects a different number of values than you sent. Count the placeholders in the approved version, header included.
- 131052, media download error: the header link isn't publicly reachable over HTTPS.
- A paused or disabled template: Meta pauses templates that collect poor quality signals. InfiQ posts template.paused and template.disabled webhooks, so you can switch to another template before sends fail.
* Per-message rates for India, ex-GST: marketing, utility and authentication effective 1 July 2026; service messages ₹0.145 since 1 October 2026 after the first 1,000 a month on each WhatsApp number, which are free (all were ₹0 until 30 September 2026). Volume commitments earn discounts — final rate is confirmed on your account; applicable GST extra. Rates for other countries differ (see the international rate table on /pricing).
Frequently asked questions
What language code should I send for an English template?+
Can I send a WhatsApp template with an image?+
Why do I get “template name does not exist in the translation”?+
Can I send a template to a customer who hasn't opted in?+
Create, approve and send templates in one place
Build templates in InfiQ, follow their review status, and send them through the same API.