Create a template
POST /templates
Shortext first checks Meta’s rules (listed in WhatsApp templates) and answers
1002 with the errors per field. Then it submits the template to Meta:
- accepted for review: the response is the template, with the status
PENDING; - refused by Meta: nothing is kept, and the
1002message says why (Meta refused the template: ...).
Authentication templates
Meta writes the text of authentication templates. You only choose their settings:
Send these templates with
content.code, see Send a template.
Edit a template
PATCH /templates/{id} changes the header, the body, the footer, the buttons or the authentication settings; what you do not send stays. The name, the language and the category cannot change.
The change is submitted to Meta for a new review (Meta limits how often an approved template can be edited). If Meta refuses it, the template stays as it was and the 1002 message says why. A published authentication template cannot be edited.
Follow the review
Meta reviews templates within minutes to a few hours. Subscribe a webhook totemplate.status_updated: it is sent when Meta approves or rejects a template, or changes its category or its quality.
data.template is the template as returned by GET /templates/{id} (shortened here); previous holds the values before the change. You can also poll GET /templates/{id}.
Let your clients write their templates
If you build a product on Shortext, your clients can write their templates themselves in the Shortext editor, without a dashboard account: create a hosted session with thetemplate purpose.
context.channel_id is required; name, category and language prefill the editor. When the template is submitted, the session completes with result.template (PENDING), and the hosted_session.completed webhook is sent. If Meta refuses the template, the page shows why and the session stays open.