Templates
Find approved templates, understand their inputs, and personalize each message with confidence.
From a saved template to a sent message
A template is a reusable WhatsApp message definition saved under a tenant-owned WhatsApp account. It includes a name, language, component structure, and provider-controlled approval status.
| Status | Can you send it? |
|---|---|
| DRAFT | No. A local draft has not been approved for sending. |
| PENDING | No. Wait for the provider’s approval decision. |
| APPROVED | Yes, when active, supported, and linked to a configured sender. |
| REJECTED / PAUSED / DISABLED | No. Resolve its status before attempting a send. |
Create or sync templates from the selected WhatsApp account in the dashboard. Existing synchronization and Meta template-status webhooks update saved template state.
Discover what a template needs
curl --request POST 'https://avbot.server.avolvelabs.com/api/v1/templates' \
--header 'Authorization: Bearer YOUR_TENANT_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"tenantId": 1}'Each result includes template_name, language, accountId, components, inputs, and senders.
{
"template_name": "order_update",
"language": "en_US",
"status": "APPROVED",
"isActive": true,
"inputs": [
{
"key": "body.1",
"label": "BODY {{1}}",
"kind": "text"
},
{
"key": "body.2",
"label": "BODY {{2}}",
"kind": "text"
}
],
"canSend": true,
"unsupportedReason": null
}canSend indicates template eligibility and sender availability. Provider credentials and recipient eligibility are checked when sending. Unsupported structures return a description in unsupportedReason.
Fill dynamic parameters
Copy the keys returned by inputs into your send request’s parameters object. Supply a string or number for every required input.
| Saved template text | Input key | Example value |
|---|---|---|
Hello {{1}} | body.1 | Alex |
Order {{2}} | body.2 | ORD-123 |
Hello {{customer_name}} | body.customer_name | Alex |
| Dynamic text header | header.1 | Order update |
{
"parameters": {
"body.1": "Alex",
"body.2": "ORD-123"
}
}Positional variables follow their numeric order; named variables use the saved names. Do not send template creation components as runtime parameters. Static templates can omit parameters.
Media headers, locations, and buttons
| Input | Key | Value |
|---|---|---|
| Image, video, or document header | header.media | An HTTPS URL or id:123456789 for uploaded Meta media. |
| Optional document filename | header.filename | invoice.pdf |
| Dynamic URL suffix | button.0.text | ORD-123 |
| Quick reply payload | button.0.payload | CONFIRM_ORDER |
| Copy-code button | button.0.coupon_code | SAVE10 |
| Location header | header.latitude, header.longitude, header.name, header.address | Coordinates, location name, and address. |
Button indexes start at zero. Media must match the saved header format. Latitude must be between −90 and 90; longitude must be between −180 and 180.
{
"parameters": {
"header.media": "https://example.com/invoice.pdf",
"header.filename": "invoice.pdf",
"body.1": "Alex",
"button.0.text": "ORD-123"
}
}Choose the language and sender explicitly
A name can be reused across accounts and languages. Add language and accountId when a name does not identify exactly one template. Choose numberId when that account has multiple linked senders.
The numberId is Meta’s phone number ID from the response’s senders, not the displayed phone number. Ambiguous requests return 409.