Concepts: Templates overview | Authentication & OTP templates
Before you send
1
Create and approve the template
Create the template in the Wazapin app or sync from Meta on official channels. Status must be approved.
GET /v1/templates lists templates for your workspace. See Channel support for official vs unofficial behavior.2
Read the template structure
Open the template in the app and note:
- Header — none, text (
{{1}}), image, video, or document - Body — static text with
{{1}},{{2}}, … placeholders - Buttons — quick reply, URL (may include
{{1}}in the link), copy code, etc.
components array must mirror these sections in order.3
Build the components array
Each section becomes one object in
content.template.components:Omit a section if the template has no variables in that part.
Request shape
All template sends usePOST /v1/messages with type: "template" and a nested content.template object (Meta-compatible shape).
Example: body variables only
Template body:Hi {{1}}, your order {{2}} is on the way.
Example: header image + body
Template with an image header and one body variable.Example: header text variable
Template header text:Hello {{1}} — the header component lives inside content.template.components.
Example: dynamic URL button
Template with a URL button containing{{1}} in the path — button component nested in the same components array.
index is the zero-based button index in the template definition. sub_type matches the button type Meta approved (url, quick_reply, copy_code, etc.).
List and sync templates with wazapin.templates.list() and wazapin.templates.sync(). See SDK templates (advanced).
Common mistakes
Related
- Sending overview — session vs template
- Example: send template
- Send a message — API reference and playground
- Channel support — unofficial channel fallback behavior
Endpoint
POST https://api.wazapin.com/v1/messages
Authenticate with X-Api-Key. See Authentication.
Response
On success, the API returns201 Created with a message record (status often starts as queued).
201 Created