Campaigns
Create a Campaign
Create a call campaign, optionally with its recipients and started, in one request.
Creates a campaign. You can supply the recipients in the same request and start it immediately, so the common case is a single call.
Your app
POST https://api.tryvox.io/v1/voice/accounts/{auth_id}/campaigns
request
TryVox
processing
response
Response 201
returned to your app
Endpoint
POST
https://api.tryvox.io/v1/voice/accounts/{auth_id}/campaignsRequest body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Your label for the campaign. |
target_type | string | yes | ai_agent or voxml. |
target_config | object | yes | See Target config. |
from | string | no | Caller ID in E.164. For ai_agent it must be a number bound to the integration. |
max_concurrent | integer | no | Calls to run at once. Capped by your account's channel limit. |
calls_per_minute | number | no | Dial-rate cap. Capped by your account's CPS limit. |
calls_per_second | number | no | The same governor in per-second terms. Use one or the other. |
complete_within_minutes | integer | no | Finish within this many minutes of starting. Preferred over complete_by. |
complete_by | string | no | Wall-clock deadline (RFC 3339). Starts counting immediately, even before the campaign runs. |
start_at | string | no | Schedule the campaign to begin at this time (RFC 3339). |
window_start | string | no | Earliest local time to dial, HH:MM. Must be set with window_end. |
window_end | string | no | Latest local time to dial, HH:MM. |
timezone | string | no | IANA zone for the calling window. Default Asia/Kolkata. |
max_attempts | integer | no | Attempts per number, 1–10. Default 1 (no redialling). |
retry_on | array | no | Which outcomes to retry: no_answer, busy, failed, unknown. |
retry_after_seconds | integer | no | Gap before a redial. Minimum 60 when max_attempts > 1. Default 3600. |
attempt_timeout_seconds | integer | no | How long one attempt may hold a channel with no result. Default 300. |
recipients | array | no | Recipients to add immediately. See Add recipients. |
start | boolean | no | Start the campaign as part of this request. |
Target config
For an AI agent:
{ "integration_id": "92b881f5-56be-4983-8001-405484f3283b" }| Field | Required | Description |
|---|---|---|
integration_id | yes | A connected, verified AI integration. |
agent_id | no | Override the agent bound to the number. |
For a VoxML application:
{ "answer_url": "https://example.com/voxml" }| Field | Required | Description |
|---|---|---|
answer_url | yes | Returns VoxML when the call answers. |
hangup_url | no | Notified when the call ends. |
fallback_url | no | Used if answer_url cannot be fetched. |
ring_timeout | no | Seconds to ring before giving up. |
time_limit | no | Maximum call length in seconds. |
caller_name | no | Display name, where the carrier supports CNAM. |
status_callback_url | no | Notified on ringing, answered and hangup. |
machine_detection | no | Accepted for compatibility; no detection runs today. |
Request example
Create, populate and start, in one request:
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H 'Content-Type: application/json' \
-d '{
"name": "December renewals",
"target_type": "ai_agent",
"target_config": { "integration_id": "92b881f5-56be-4983-8001-405484f3283b" },
"from": "+912250658839",
"max_concurrent": 3,
"complete_within_minutes": 120,
"window_start": "09:00",
"window_end": "21:00",
"timezone": "Asia/Kolkata",
"max_attempts": 2,
"retry_on": ["no_answer", "busy"],
"retry_after_seconds": 3600,
"recipients": [
{ "to": "+919876543210", "client_ref": "CUST-1001", "variables": { "name": "Asha", "due_date": "2026-12-01" } },
{ "to": "+919123456789", "client_ref": "CUST-1002", "variables": { "name": "Rahul", "due_date": "2026-12-05" } }
],
"start": true
}'Response
{
"data": {
"campaign": {
"id": "b91963bd-6dd3-430d-9a11-0cc57ada16cb",
"name": "December renewals",
"target_type": "ai_agent",
"status": "running",
"source": "api",
"from_number": "+912250658839",
"max_concurrent": 3,
"complete_within_seconds": 7200,
"window_start": "09:00",
"window_end": "21:00",
"timezone": "Asia/Kolkata",
"max_attempts": 2,
"retry_after_seconds": 3600,
"retry_on": ["no_answer", "busy"],
"attempt_timeout_seconds": 300,
"total_recipients": 2,
"created_at": "2026-11-19T08:29:35Z"
},
"intake": {
"accepted": 2,
"duplicates": 0,
"problems": []
}
}
}| Field | Description |
|---|---|
campaign.id | Use this for every other campaign call. |
campaign.status | draft unless you passed start. |
intake.accepted | Recipients stored. |
intake.duplicates | Numbers already present, skipped. |
intake.problems | Rows rejected, with the reason. |
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | A field is missing or invalid. The message names it. |
| 400 | VALIDATION_FAILED | The deadline cannot be met — the message gives the channels needed and the time it would actually take. |
| 401 | INVALID_TOKEN | Auth ID or token is wrong. |
A campaign created without start sits in draft until you start it. Creating is always safe: nothing dials until a campaign is started.