Voice API
The Voice API powers AI phone calls: cloned voices, scripts, scheduled campaigns, and per-call session transcripts.
Voices
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/voice/voices` | List cloned voices |
| POST | `/api/v1/voice/voices/clone` | Clone a voice (multipart/form-data, samples required) |
| DELETE | `/api/v1/voice/voices/:id` | Delete |
| POST | `/api/v1/voice/voices/:id/preview` | Generate a preview MP3 |
Scripts
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/voice/scripts` | List |
| POST | `/api/v1/voice/scripts` | Create |
| PATCH | `/api/v1/voice/scripts/:id` | Update |
| DELETE | `/api/v1/voice/scripts/:id` | Delete |
A script carries opening line, closing line, system prompt, and an array of { trigger, response } objection responses.
Campaigns
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/voice/campaigns` | List |
| POST | `/api/v1/voice/campaigns` | Create (binds script + voice + contact list) |
| GET | `/api/v1/voice/campaigns/:id` | Get with stats |
| POST | `/api/v1/voice/campaigns/:id/start` | Start dialling |
| POST | `/api/v1/voice/campaigns/:id/pause` | Pause |
| POST | `/api/v1/voice/campaigns/:id/stop` | Stop |
| GET | `/api/v1/voice/campaigns/:id/sessions` | Per-call sessions |
Sessions
| Method | Path | Description |
|---|---|---|
| GET | `/api/v1/voice/sessions` | List with filters |
| GET | `/api/v1/voice/sessions/:id` | Full transcript + outcome |
| GET | `/api/v1/voice/sessions/:id/transcript` | Just the transcript |
| POST | `/api/v1/voice/sessions/:id/callback` | Schedule a callback |
| POST | `/api/v1/voice/calls/test` | Place a single test call |
Every response uses the standard envelope:
{
"success": true,
"data": { /* resource or array */ },
"meta": { "total": 100, "cursor": "...", "hasMore": true },
"error": { "code": "ERROR_CODE", "message": "Human readable" }
}error is omitted on success; meta is omitted when not paginating.
Rate Limits
Voice campaign endpoints are subject to the standard 200/min auth limit. Per-call dialling is rate-limited downstream by Twilio's account-level cap, not Anvil's gateway.