Templates
List the message templates approved on your account so you know what you can send and how many variables each takes.
List templates
GET
/templatesRequires the templates:read scope. Only approved templates are returned — everything listed is sendable as-is.
bash
curl "$MYWA_API/templates" -H "Authorization: Bearer $MYWA_KEY"json
{
"templates": [
{
"name": "otp_code",
"language": "en_US",
"category": "AUTHENTICATION",
"body": "Your verification code is {{1}}",
"variableCount": 1
},
{
"name": "order_shipped",
"language": "en_US",
"category": "UTILITY",
"body": "Hi {{1}}, order {{2}} is on its way. Track it: {{3}}",
"variableCount": 3
}
]
}Fields
| Field | Type | Description |
|---|---|---|
name | string | Pass this as template.name when sending. |
language | string | BCP-47 code. Pass as template.language if a name has multiple languages. |
category | string | AUTHENTICATION, UTILITY, or MARKETING. |
body | string | The body text with {{n}} placeholders. |
variableCount | number | How many values to pass in template.variables, in order. |
Matching variables
Send exactly
variableCount values in template.variables. For order_shipped above that’s three: the name, the order number, and the tracking link.Creating templates
Templates are authored and submitted to Meta for approval from the Templates page in the app — not via the API. Authentication templates (OTP) are usually approved quickly; marketing templates take longer. Once approved they appear in this endpoint.