Skip to main content
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

Reference

client.campaigns.list(...)

List campaigns HTTPGET /api/v1/campaigns · API reference →

client.campaigns.get(...)

Get a campaign HTTPGET /api/v1/campaigns/{id} · API reference →

client.campaigns.create(...)

Create a campaign HTTPPOST /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 HTTPPOST /api/v1/campaigns/{id}/start · API reference →
Flips the campaign from draft/paused to running. The dispatcher goroutine begins originating calls subject to per-tenant rate caps.

client.campaigns.pause(...)

Pause a running campaign HTTPPOST /api/v1/campaigns/{id}/pause · API reference →
Stops the dispatcher from originating new calls; in-flight calls finish naturally.

client.campaigns.resume(...)

Resume a paused campaign HTTPPOST /api/v1/campaigns/{id}/resume · API reference →

client.campaigns.stop(...)

Stop a campaign permanently HTTPPOST /api/v1/campaigns/{id}/stop · API reference →
Terminal state — no further dispatches, contacts in pending move to cancelled. Cannot be reversed; create a new campaign to redo the work.

client.campaigns.delete(...)

Delete a campaign HTTPDELETE /api/v1/campaigns/{id} · API reference →
Refuses if the campaign is running. Pause or stop it first.

client.campaigns.list_contacts(...)

List contacts in a campaign HTTPGET /api/v1/campaigns/{id}/contacts · API reference →

client.campaigns.stream_events(...)

Iterate over Server-Sent Events for a campaign.
Yields decoded JSON dicts for 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).