Campaigns
Campaigns let you orchestrate batches of outbound calls. Create a campaign, upload contacts, and dispatch — Rymi handles the Plivo dialing, DNC filtering, and status tracking.
Create Campaign
http
POST /campaigns| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | ✅ | Agent persona to use for calls |
name | string | ✅ | Human-readable campaign name |
call_from_number | string | ✅ | Purchased Rymi number to dial from |
Response 201
json
{ "status": "created", "campaign_id": "cmp_550e8400-..." }List Campaigns
http
GET /campaignsGet Campaign
http
GET /campaigns/:idUpdate Campaign
http
PUT /campaigns/:idDelete Campaign
http
DELETE /campaigns/:idCampaign Contacts
Upload Contacts
Bulk upload contacts to a campaign. Each contact can include custom variables that the agent can reference during the call.
http
POST /campaigns/:id/contactsbash
curl -X POST https://api.rymi.ai/v1/campaigns/cmp_123/contacts \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"contacts": [
{ "phone_number": "15559990001", "variables": { "name": "Alice", "plan": "Gold" } },
{ "phone_number": "15559990002", "variables": { "name": "Bob", "plan": "Silver" } }
]
}'Response 201
json
{ "status": "success", "inserted_count": 2 }List Contacts
http
GET /campaigns/:id/contactsCampaign Lifecycle
Start Campaign
Dispatches calls to all pending contacts. Contacts on the DNC list are automatically skipped and marked as skipped_dnc.
http
POST /campaigns/:id/startResponse 200
json
{
"message": "Campaign Dispatched Successfully",
"contacts_dialed": 48,
"contacts_skipped_dnc": 2
}Pause Campaign
http
POST /campaigns/:id/pauseResponse 200
json
{ "status": "paused", "id": "cmp_123" }Resume Campaign
http
POST /campaigns/:id/resumeResponse 200
json
{ "status": "running", "id": "cmp_123" }Campaign Status Flow
draft → running → completed
↕
pausedContact Status Flow
pending → dialed → completed
→ failed
→ skipped_dnc