Endpoints at a glance
| Method | Path | Summary |
|---|---|---|
GET | /api/v1/campaigns | List campaigns |
POST | /api/v1/campaigns | Create a campaign |
GET | /api/v1/campaigns/{id} | Get a campaign |
DELETE | /api/v1/campaigns/{id} | Delete a campaign |
GET | /api/v1/campaigns/{id}/contacts | List contacts in a campaign |
GET | /api/v1/campaigns/{id}/events | Stream campaign events |
POST | /api/v1/campaigns/{id}/pause | Pause a running campaign |
POST | /api/v1/campaigns/{id}/resume | Resume a paused campaign |
POST | /api/v1/campaigns/{id}/start | Start a campaign |
POST | /api/v1/campaigns/{id}/stop | Stop a campaign permanently |
Reference
GET /api/v1/campaigns
List campaigns
Responses
| Code | Description | Body |
|---|---|---|
200 | OK | object |
500 | Database error | string |
POST /api/v1/campaigns
Create a campaign
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.
Request body (application/json)
Responses
| Code | Description | Body |
|---|---|---|
201 | Created | data.Campaign |
400 | Invalid form / CSV | string |
500 | Database error | string |
GET /api/v1/campaigns/{id}
Get a campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | OK | data.Campaign |
404 | Campaign not found | string |
500 | Database error | string |
DELETE /api/v1/campaigns/{id}
Delete a campaign
Refuses if the campaign is running. Pause or stop it first.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
204 | Deleted | — |
404 | Campaign not found | string |
409 | Campaign is running | string |
GET /api/v1/campaigns/{id}/contacts
List contacts in a campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
status | query | string | No | Filter by contact status (pending, originated, connected, completed, failed, cancelled) |
limit | query | integer | No | Page size |
offset | query | integer | No | Pagination offset |
| Code | Description | Body |
|---|---|---|
200 | OK | object |
500 | Database error | string |
GET /api/v1/campaigns/{id}/events
Stream campaign events
Server-Sent Events stream of contact-level state transitions (originated, connected, failed, …). Stays open until the client disconnects.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | SSE stream | — |
404 | Campaign not found | — |
POST /api/v1/campaigns/{id}/pause
Pause a running campaign
Stops the dispatcher from originating new calls; in-flight calls finish naturally.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | OK | data.Campaign |
404 | Campaign not found | string |
409 | Campaign cannot be paused in its current state | string |
POST /api/v1/campaigns/{id}/resume
Resume a paused campaign
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | OK | data.Campaign |
404 | Campaign not found | string |
409 | Campaign cannot be resumed in its current state | string |
POST /api/v1/campaigns/{id}/start
Start a campaign
Flips the campaign from draft/paused to running. The dispatcher goroutine begins originating calls subject to per-tenant rate caps.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | OK | data.Campaign |
404 | Campaign not found | string |
409 | Campaign cannot be started in its current state | string |
500 | Database error | string |
POST /api/v1/campaigns/{id}/stop
Stop a campaign permanently
Terminal state — no further dispatches, contacts in pending move to cancelled. Cannot be reversed; create a new campaign to redo the work.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | Campaign id |
| Code | Description | Body |
|---|---|---|
200 | OK | data.Campaign |
404 | Campaign not found | string |

