Skip to main content
PUT

Cadence draft

Writes the whole draft of a cadence: name, filter, delinquency bands and the contacts of each band. The draft always saves, even incomplete; full validation happens when you publish. Editing a published cadence opens a draft from the version in force.

Endpoints

DELETE discards the draft; the version in force keeps running.

Concurrent edits

Always send the lock_version you read (from the get or the last save). If the get returned draft: null, send 0: the save opens a draft from the version in force. If someone saved after that, the response is 409 and nothing changes: get the cadence again and reapply your change.

Request body

integer
required
The lock_version of the draft you read.
string
required
Cadence name, up to 120 characters.
string
Description, up to 2,000 characters.
object
required
Who enters the cadence. See Filter. {} or no groups = every debt.
object
Agreement in force: pauses (the agreement pauses the cadence), pause_days (for how many days, 1 to 365) and broken_returns (a broken agreement returns to the cadence).
integer
Pause after the person replies in any channel, 0 to 30 days. 0 = never pauses.
array
required
The delinquency bands, up to 20. See Bands.

Filter

  • root and each group’s op: and or or. Up to 20 groups, 30 conditions per group.
  • field: a fixed contract field (creditor, amount_due, overdue_amount, installment_amount, collection_phase, risk_class, overdue_installments, installments_total, credit_limit, payment_deadline, campaign_id, debt_key_source, provenance) or a free field (custom.<key>). Your workspace’s list comes in filter_fields on the get.
  • operator: eq, neq, in, not_in, gt, gte, lt, lte, contains, empty, not_empty.
  • Delinquency is not a filter field: it defines the band.

Bands

Each band is a range of days overdue, with the contacts of that band. Bands cannot overlap; a gap between bands is allowed.

Contacts

channel_config by channel:
  • voice: {"agent_id": "…"} (calls directly through the agent) or {"campaign_id": "…"} (puts the attempt into a campaign). Never both.
  • whatsapp: {"messaging_account_id": "…", "template_id": "…", "variables": {"body:1": "name", "body:2": "amount_due"}}. Each template variable points to a fixed field (name, document, debt_key, creditor, currency, amount_due, overdue_amount, installment_amount, credit_limit, due_date, payment_deadline, days_overdue, overdue_installments, installments_total, collection_phase, risk_class, payment_slip) or to a free field (custom.<key>). Approved Utility templates only.
  • webhook: {"url": "https://…", "http_method": "POST", "auth_scheme": "bearer", "auth_token": "…", "headers": [{"key": "X-Tenant", "value": "…"}], "payload_template": "", "timeout": 10, "max_retries": 3}.
  • enrich: {"min_unanswered_calls": null} or 1 to 10.
Repetition (repeat): mode (single, daily, every_n with every 2 to 30, weekdays with weekdays from 1 = Monday to 7 = Sunday), to (last day overdue), attempts (1 to 6 a day), attempt_mode (interval with start_time and interval_minutes, or times with a list of HH:MM times) and stop_when (answered, replied, agreement).
The webhook token and header values never come back in a response: they show as {"set": true}. To keep the stored secret, send {"set": true} back (or omit the field). To change it, send the new value. To remove it, send null.

Examples

Response

Each contact of the returned draft carries summary, the one-line summary the screen shows.

Error responses