Overview
Templates can be associated with specific cadence steps to send official WhatsApp Business messages. This is especially useful for re-engaging leads after the 24-hour window.
Create Association
POST /backend/templates/cadence-associations
Body:
{
"cadence_id": "uuid",
"step_index": 0,
"message_index": 0,
"template_id": "uuid",
"parameter_mapping": {
"1": "{{LEAD_NAME}}",
"2": "Leavo"
}
}
| Field | Type | Required | Description |
|---|
cadence_id | UUID | Yes | Cadence ID |
step_index | integer | Yes | Step index in the cadence |
message_index | integer | Yes | Message index in the step |
template_id | UUID | Yes | Template ID (must be APPROVED) |
parameter_mapping | object | No | Template parameter mapping |
Only templates with APPROVED status can be associated with cadences.
Response (201):
{
"id": "uuid",
"tenant_id": "uuid",
"cadence_id": "uuid",
"step_index": 0,
"message_index": 0,
"template_id": "uuid",
"parameter_mapping": {
"1": "{{LEAD_NAME}}",
"2": "Leavo"
},
"template": {
"id": "uuid",
"template_name": "welcome_v1",
"language": "en",
"status": "APPROVED"
},
"created_at": "2024-01-15T10:00:00Z"
}
List Cadence Associations
GET /backend/templates/cadence-associations?cadence_id={cadence_id}
Update Parameter Mapping
PUT /backend/templates/cadence-associations/{id}/params
Body:
{
"parameter_mapping": {
"1": "{{LEAD_FIRSTNAME}}",
"2": "Leavo Team"
}
}
Remove Association
DELETE /backend/templates/cadence-associations/{id}
Response: 204 No Content
Available Variables
Use these variables in parameter_mapping to personalize messages:
| Variable | Description |
|---|
{{LEAD_NAME}} | Lead’s full name |
{{LEAD_FIRSTNAME}} | Lead’s first name |
{{LEAD_NUMBER}} | Lead’s phone number |
{{COMPANY_NAME}} | Lead’s company name |
{{LEAD_FIELD_KEY}} | Custom field value (replace KEY with the field key) |