Template messages
Templates are messages Meta has approved in advance. They can be sent at any time, so they are how you start a conversation or follow up after 24 hours. Create them in the panel under Templates (or pick one from the library) and wait for Meta’s approval. GET /templates lists the approved ones.
| Field | Type | Description |
|---|---|---|
template.name |
string | The template’s name, exactly as approved |
template.language |
string or object | Its language code, e.g. en_US, en, hi, gu, or Meta’s { "code": "en" }. Must match the approved translation. Default en_US. |
template.components |
array | Values for the template’s variables, media header and buttons, in Meta’s format (below). Omit when the template has no variables. |
A template with variables
Section titled “A template with variables”For a body like Hi {{1}}, your order {{2}} is confirmed:
curl https://login.meapi.in/api/v1/messages \ -H "Authorization: Bearer $MEAPI_KEY" -H "Content-Type: application/json" \ -d '{ "to": "+919812345678", "type": "template", "template": { "name": "order_confirmation", "language": "en", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Asha" }, { "type": "text", "text": "#10245" } ] } ] } }'const body = { to: '+919812345678', type: 'template', template: { name: 'order_confirmation', language: 'en', components: [{ type: 'body', parameters: [{ type: 'text', text: 'Asha' }, { type: 'text', text: '#10245' }] }], },};await fetch('https://login.meapi.in/api/v1/messages', { method: 'POST', headers: { Authorization: `Bearer ${process.env.MEAPI_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify(body),});<?php$payload = [ 'to' => '+919812345678', 'type' => 'template', 'template' => [ 'name' => 'order_confirmation', 'language' => 'en', 'components' => [[ 'type' => 'body', 'parameters' => [['type' => 'text', 'text' => 'Asha'], ['type' => 'text', 'text' => '#10245']], ]], ],];$ch = curl_init('https://login.meapi.in/api/v1/messages');curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MEAPI_KEY'), 'Content-Type: application/json'], CURLOPT_POSTFIELDS => json_encode($payload)]);echo curl_exec($ch);payload = { "to": "+919812345678", "type": "template", "template": { "name": "order_confirmation", "language": "en", "components": [{"type": "body", "parameters": [ {"type": "text", "text": "Asha"}, {"type": "text", "text": "#10245"}]}], },}requests.post("https://login.meapi.in/api/v1/messages", headers={"Authorization": f"Bearer {MEAPI_KEY}"}, json=payload, timeout=30)Named variables. If the template uses names like {{customer_name}} instead of numbers, add parameter_name to each value:
{ "type": "body", "parameters": [ { "type": "text", "parameter_name": "customer_name", "text": "Asha" }, { "type": "text", "parameter_name": "order_id", "text": "#10245" }] }Media header
Section titled “Media header”For a template with an image, video or document header, pass the file as a public https link:
"components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://example.com/offer.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Asha" } ] }]Use "type": "document", "document": { "link": "…", "filename": "Invoice-10245.pdf" } for documents, and video for videos.
Buttons
Section titled “Buttons”Quick-reply buttons need nothing. A URL button whose address ends in a variable (e.g. https://shop.com/track/{{1}}) needs the suffix, with the button’s position (index, starting at "0"):
{ "type": "button", "sub_type": "url", "index": "0", "parameters": [ { "type": "text", "text": "10245" } ] }One-time passwords (authentication templates)
Section titled “One-time passwords (authentication templates)”Authentication templates carry the code twice — in the body and in the copy-code button:
"components": [ { "type": "body", "parameters": [ { "type": "text", "text": "482913" } ] }, { "type": "button", "sub_type": "url", "index": "0", "parameters": [ { "type": "text", "text": "482913" } ] }]Common template errors
Section titled “Common template errors”Template problems are reported by Meta after sending, so the API accepts the request (202) and the message later becomes failed with Meta’s reason in error — for example a wrong number of parameters, a template that isn’t approved in that language, or a paused template. Watch message.status events or poll the status.
Was this page helpful?
Thank you — we read every comment.
Could not send right now. Please try again later.
© 2026 MeAPI by TheWebStore028 · RADHAMADHAV WEBSTORE LLP · GSTIN 27ABJFR6148J1ZO · Contact us ·Cookie settings