API reference

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/templates

Requires 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

FieldTypeDescription
name
stringPass this as template.name when sending.
language
stringBCP-47 code. Pass as template.language if a name has multiple languages.
category
stringAUTHENTICATION, UTILITY, or MARKETING.
body
stringThe body text with {{n}} placeholders.
variableCount
numberHow 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.

MywaHey 👋 got a question? Say hi, a real human replies here.now