CampaignsClient is reachable on every Kataven client as client.campaigns. Each method maps to one HTTP endpoint on the Hub API; links to the underlying spec entry are inline below.
Bulk outbound campaigns dialled from CSV with cap-aware concurrency, retry logic, and live progress metrics over Server-Sent Events.
Methods at a glance
| Method | HTTP | Summary |
|---|---|---|
list | GET /api/v1/campaigns | List campaigns |
get | GET /api/v1/campaigns/{campaign_id} | Get a campaign |
create | POST /api/v1/campaigns | Create a campaign |
start | POST /api/v1/campaigns/{campaign_id}/start | Start a campaign |
pause | POST /api/v1/campaigns/{campaign_id}/pause | Pause a running campaign |
resume | POST /api/v1/campaigns/{campaign_id}/resume | Resume a paused campaign |
stop | POST /api/v1/campaigns/{campaign_id}/stop | Stop a campaign permanently |
delete | DELETE /api/v1/campaigns/{campaign_id} | Delete a campaign |
list_contacts | GET /api/v1/campaigns/{campaign_id}/contacts | List contacts in a campaign |
stream_events | (client-side) | Iterate over Server-Sent Events for a campaign. |
Reference
client.campaigns.list(...)
List campaigns
HTTP — GET /api/v1/campaigns · API reference →
client.campaigns.get(...)
Get a campaign
HTTP — GET /api/v1/campaigns/{id} · API reference →
client.campaigns.create(...)
Create a campaign
HTTP — POST /api/v1/campaigns · API reference →
contacts must be a binary file-like (open in rb mode). The CSV’s
first row is headers and must include phone_number. Other columns
become custom_fields.
Multipart form upload — contacts is a CSV file, every other field is a form value. The CSV must contain at least a phone_number column. The campaign is created in draft state and dispatch starts only after start.
client.campaigns.start(...)
Start a campaign
HTTP — POST /api/v1/campaigns/{id}/start · API reference →
draft/paused to running. The dispatcher goroutine begins originating calls subject to per-tenant rate caps.
client.campaigns.pause(...)
Pause a running campaign
HTTP — POST /api/v1/campaigns/{id}/pause · API reference →
client.campaigns.resume(...)
Resume a paused campaign
HTTP — POST /api/v1/campaigns/{id}/resume · API reference →
client.campaigns.stop(...)
Stop a campaign permanently
HTTP — POST /api/v1/campaigns/{id}/stop · API reference →
pending move to cancelled. Cannot be reversed; create a new campaign to redo the work.
client.campaigns.delete(...)
Delete a campaign
HTTP — DELETE /api/v1/campaigns/{id} · API reference →
running. Pause or stop it first.
client.campaigns.list_contacts(...)
List contacts in a campaign
HTTP — GET /api/v1/campaigns/{id}/contacts · API reference →
client.campaigns.stream_events(...)
Iterate over Server-Sent Events for a campaign.
data: frames. Heartbeat comments
and event: end markers are yielded as raw strings so the caller
can choose to filter or react. Iteration ends naturally when the
server closes the stream (campaign reaches a terminal status).
