Skip to main content

Create template

POST 

/templates

Creates a template on Meta. It starts as PENDING and approval takes minutes to hours — the result arrives through the message_template_status_update webhook.

Before sending it to Meta we validate the components locally and return 422 invalid_request with an issues field pointing at the problem. That avoids the slow submit-wait-rejected cycle.

What gets validated​

  • Variables with no declared example
  • Examples with an empty value
  • Gaps in positional numbering ({{1}}, {{3}} with no {{2}})
  • Mixing positional and named formats in one template
  • More than one variable in a text header
  • Any variable in the footer
  • A URL button with a variable and no example URL
  • An invalid identifier in a named variable
  • A declared parameterFormat that contradicts the text

From Meta's template library​

Instead of components you may send libraryTemplateName with the name of an item from GET /templates/library. The copy is then Meta's and goes through no validation of ours — what you fill in is only what the item asks for (button URL, phone number). The two paths are mutually exclusive: sending both is 422.

Request​

Responses​

Template created, waiting for approval.