Campaigns
Call a list of contacts with an agent, inside a calling window, with retries, schedules and A/B tests.
A campaign is one agent calling a list of contacts inside a calling window, a few at a time, with retries. Needs agents.write.
Create from JSON#
curl -X POST https://api.voicemint.io/api/v1/agents/campaigns/json \
-H "Authorization: Bearer $VOICEMINT_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: renewals-2026-12-07" \
-d '{
"name": "December renewals",
"agent_id": "AGENT_ID",
"window": {"timezone": "Asia/Kolkata", "start": "10:00", "end": "19:00", "days": [0,1,2,3,4,5]},
"contacts": [
{"phone": "+919876543210", "name": "Asha", "variables": {"plan": "gold"}, "language": "hi-IN"},
{"phone": "9876543211"}
]
}'Or upload a CSV with client.campaigns.create("contacts.csv", {...}) (POST /agents/campaigns); CSV columns become {variables}. A bare number gets default_country (default +91). Invalid numbers are reported by position, duplicates dropped, DND and your suppression list scrubbed (skipped), at most 5,000 contacts. The campaign stays a draft until started.
Control and results#
| Call | Does |
|---|---|
POST /agents/campaigns/{id}/start, pause, resume, cancel, skip-next | control (409 when the status does not allow it) |
POST /agents/campaigns/{id}/contacts | append contacts (same limits; Idempotency-Key supported) |
GET /agents/campaigns/{id} | status, counts per contact status, progress, credits |
GET /agents/campaigns/{id}/contacts?status= | per-contact result: attempts, last outcome, duration, call_id |
Campaign calls send the same webhooks as single calls, with campaign_id and contact_id.
Schedules and A/B tests#
schedule runs a campaign once at a set time or on recurring days ({"kind": "recurring", "days": [0,1,2,3,4], "start": "10:00", "end": "13:00", "end_date": "2026-12-31"}), inside its calling window. ab_test splits contacts across 2–4 variants (agent, agent version, caller-id pool or prompt variables) and compares success rates; promote a winner with POST /agents/campaigns/{id}/ab/promote.
Billing and caps#
Each call reserves a few minutes of credits, settled when it ends. If the account (or the key's spend cap) cannot cover the next call, the campaign pauses with insufficient_credits; resume it after topping up.