Skip to content
Login
Core conceptsAPI v1

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.

StatusCan you send it?
DRAFTNo. A local draft has not been approved for sending.
PENDINGNo. Wait for the provider’s approval decision.
APPROVEDYes, when active, supported, and linked to a configured sender.
REJECTED / PAUSED / DISABLEDNo. 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

Request · cURL
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.

Example template · excerpt
{
  "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 textInput keyExample value
Hello {{1}}body.1Alex
Order {{2}}body.2ORD-123
Hello {{customer_name}}body.customer_nameAlex
Dynamic text headerheader.1Order update
Send request parameters
{
  "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

InputKeyValue
Image, video, or document headerheader.mediaAn HTTPS URL or id:123456789 for uploaded Meta media.
Optional document filenameheader.filenameinvoice.pdf
Dynamic URL suffixbutton.0.textORD-123
Quick reply payloadbutton.0.payloadCONFIRM_ORDER
Copy-code buttonbutton.0.coupon_codeSAVE10
Location headerheader.latitude, header.longitude, header.name, header.addressCoordinates, 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.

Document header and dynamic button · example inputs
{
  "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.

Send a template message
AV Bot · Developer documentationBuilt for better conversations.