Bulk delete leads (hybrid sync/async)
Leads
Bulk delete leads (hybrid sync/async)
Delete leads in bulk. Polymorphic body: pass `ids: uuid[]` (max 500, sync only)
OR `filter: {list_id?, status?, tag?}` (any size; gateway recounts then auto-routes
sync if <=500 / async via job table if >500).
Sync mode (200) returns `{kind:'sync', deleted, skipped, skipped_payload}`. Async
mode (202) returns `{kind:'async', job_id, status:'pending', total_leads, chunks_total}` —
a background worker drains the job in 1000-row chunks; client polls or watches
notifications for terminal status.
Hard delete: `lead_list_assignments` cascades automatically; `calls.lead_id` becomes NULL
via existing FK. There is no undo. Requires scope: `leads:write`.
POST
Bulk delete leads (hybrid sync/async)
Authorizations
Use Authorization: Bearer tc_live_xxxxx
Body
application/json