Skip to content

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.

For a body like Hi {{1}}, your order {{2}} is confirmed:

Terminal window
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" }
] }
]
}
}'

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" }
] }

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.

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" } ] }
]

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.

© 2026 MeAPI by TheWebStore028 · RADHAMADHAV WEBSTORE LLP · GSTIN 27ABJFR6148J1ZO · Contact us ·Cookie settings