Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.leavo.ai/llms.txt

Use this file to discover all available pages before exploring further.

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"
  }
}
FieldTypeRequiredDescription
cadence_idUUIDYesCadence ID
step_indexintegerYesStep index in the cadence
message_indexintegerYesMessage index in the step
template_idUUIDYesTemplate ID (must be APPROVED)
parameter_mappingobjectNoTemplate 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:
VariableDescription
{{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)