Campaigns
Start, Pause and Edit
Control a running campaign — start, pause, resume, cancel, and change its settings.
A campaign moves through a small set of states, and each control is only valid from some of them.
| Status | Meaning |
|---|---|
draft | Created, not started. Nothing dials. |
scheduled | Started, waiting for its start_at. |
running | Dialling, within its calling hours. |
paused | Stopped by you, or by itself after a configuration failure. |
completed | Every recipient reached a final state. |
cancelled | Stopped permanently; the queue was cleared. |
Start
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID/start \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKENValid from draft, paused and scheduled — so the same call both starts a new campaign and resumes a paused one, picking up where it stopped.
Two checks run before anything dials:
- The campaign must have something to dial.
400 VALIDATION_FAILED— campaign has no recipients to dial. - A deadline must be reachable. If the campaign has
complete_within_minutesorcomplete_by, TryVox works out the channels that would need and refuses if your account does not have them. The message carries the arithmetic.
If start_at is in the future the campaign goes to scheduled rather than running, and begins on its own at that time.
The deadline clock starts here, not at creation — so time spent uploading your list never counts against it.
Pause
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID/pause \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKENValid from running and scheduled. New calls stop; calls already connected run to their natural end — pausing is not a mass hangup. Recipients already claimed for the current batch but not yet dialled are returned to the queue.
Resume with start.
Cancel
curl -X POST https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID/cancel \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKENValid from draft, scheduled, running and paused. Everything still waiting is marked cancelled and will never be dialled. Like pause, it does not hang up calls in progress.
Cancelling is final — a cancelled campaign cannot be restarted. Pause instead if you may want to carry on.
Campaigns that pause themselves
If a call fails for a reason that would fail every call — most often an AI integration with no number bound to it — the campaign stops after the first failure rather than burning through your list. It moves to paused with a pause_reason in the provider's own words:
{ "status": "paused", "pause_reason": "integration has no number to call from" }The remaining recipients are untouched. Fix the configuration, then start again.
This is why a misconfigured campaign costs you one failed call instead of ten thousand.
Edit
curl -X PATCH https://api.tryvox.io/v1/voice/accounts/$TRYVOX_AUTH_ID/campaigns/$CAMPAIGN_ID \
-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": 6,
"complete_within_minutes": 90,
"window_start": "10:00",
"window_end": "19:00",
"timezone": "Asia/Kolkata",
"max_attempts": 1
}'The body takes the same fields as Create, minus recipients and start.
This is a replacement, not a sparse merge. Send the complete set of settings you want, not only the ones you are changing — anything you leave out is cleared. That is deliberate: with a sparse patch there is no way to express remove the deadline.
What can be edited, and when
| Status | Editable |
|---|---|
draft, scheduled, paused | Yes |
running | No — pause it first |
completed, cancelled, failed | No |
A running campaign is refused because its dialler reads these settings on every tick; an edit in flight would change the pace or calling hours of calls already in the air with no clear before and after. Pause, edit, start — it is one extra call.
The target locks once any call has gone out. After the first dial, target_type, target_config and from can no longer be changed, because the results already recorded belong to them. Pace, calling hours, retries and the deadline stay editable for the whole life of the campaign — they only govern calls not yet placed.
Get campaign reports both rules so you do not have to derive them:
"edit": { "editable": true, "target_locked": true, "reason": "" }Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | The transition is not valid from the current status, the deadline cannot be met, or a field is invalid. |
| 400 | VALIDATION_FAILED | campaign changed state while being edited; reload and try again — it started between your read and your write. |
| 404 | NOT_FOUND | No campaign with that id on this account. |