Skip to main content
All campaign endpoints require an API key with the appropriate scope. Campaigns are scoped to the tenant bound to your API key.

Create a campaign

curl -X POST https://api.yotel.in/api/v1/campaigns \
  -H "Authorization: Bearer yt_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "May outreach",
    "dial_mode": "progressive",
    "voice_agent_id": "va_abc123"
  }'

Request body

FieldTypeRequiredDescription
namestringYesCampaign display name
dial_modestringYes"preview", "progressive", or "predictive"
voice_agent_idstringNoAttach a voice agent to handle answered calls
post_answer_actionstringNo"connect_agent" (default), "connect_voice_agent", or "run_flow"
predictive_target_abandonnumberNoTarget abandon rate for predictive mode (max 0.03 — TRAI hard cap)
predictive_max_wait_snumberNoMax seconds an answered lead waits for an agent in predictive mode
Scope: campaigns:write  |  Status: 201 Created

Response

Returns a CampaignResponse object with id, name, dial_mode, status ("draft"), timestamps, and all configured fields.

List campaigns

Returns all campaigns for the tenant bound to your API key.
curl https://api.yotel.in/api/v1/campaigns \
  -H "Authorization: Bearer yt_live_YOUR_KEY"
Scope: campaigns:read  |  Status: 200 OK

Get a campaign

curl https://api.yotel.in/api/v1/campaigns/{campaign_id} \
  -H "Authorization: Bearer yt_live_YOUR_KEY"
Scope: campaigns:read  |  Status: 200 OK Returns 404 if the campaign does not exist or belongs to a different tenant.

Update a campaign

PATCH semantics — only include the fields you want to change.
curl -X PATCH https://api.yotel.in/api/v1/campaigns/{campaign_id} \
  -H "Authorization: Bearer yt_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated name"}'
Scope: campaigns:write  |  Status: 200 OK

Delete a campaign

curl -X DELETE https://api.yotel.in/api/v1/campaigns/{campaign_id} \
  -H "Authorization: Bearer yt_live_YOUR_KEY"
Scope: campaigns:write  |  Status: 204 No Content Returns 409 Conflict if the campaign is in a state that cannot be deleted (e.g., currently running).

Errors

StatusCondition
404Campaign not found or belongs to another tenant
409Campaign is in a state that prevents the operation
422Validation error (e.g., predictive_target_abandon > 0.03)