Integrations
AI Agents API
Manage provider integrations and number bindings, and start outbound AI calls, over the API.
Everything the dashboard's AI Agents page does is available over the API: connect a provider, bind TryVox numbers to its agents, start outbound calls, and read call history.
All endpoints are under https://api.tryvox.io/v1/ai and authenticate with your Auth ID and Auth Token like every other request. Your provider API key is stored encrypted and never returned.
Provider Capabilities
| Provider | provider value | Inbound | Outbound started by your agent in the provider | Outbound via Start a Call |
|---|---|---|---|---|
| Vapi | vapi | ✅ | ✅ | ✅ |
| ElevenLabs Conversational AI | elevenlabs | ✅ | ✅ | ✅ |
| Retell | retell | ✅ | ✅ | ❌ returns 501 NOT_SUPPORTED |
| LiveKit | livekit | ✅ | ✅ | ✅ |
| Bolna | bolna | ✅ | ✅ | ✅ |
Outbound calls in every column leave from a bound TryVox number and are recorded and billed in TryVox like any other call.
GET /v1/ai/providers returns the provider values the platform accepts:
{ "providers": ["bolna", "elevenlabs", "livekit", "retell", "vapi"] }Integrations
An integration is one provider account connected with its API key.
| Method | Path | Purpose |
|---|---|---|
POST | /v1/ai/integrations | Connect a provider |
GET | /v1/ai/integrations | List integrations |
GET | /v1/ai/integrations/{id} | Get one |
PATCH | /v1/ai/integrations/{id} | Update name, key, settings, status, or limits |
DELETE | /v1/ai/integrations/{id} | Disconnect, releasing every bound number at the provider |
POST | /v1/ai/integrations/{id}/test | Check the stored key still works |
GET | /v1/ai/integrations/{id}/agents | List the provider's agents |
POST | /v1/ai/integrations/{id}/agents/verify | Check an agent name exists (body: {"agent_name": "..."}) |
Connect a provider
curl -X POST https://api.tryvox.io/v1/ai/integrations \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{
"provider": "vapi",
"name": "Support agents",
"api_key": "<your-vapi-private-key>"
}'| Field | Type | Required | Description |
|---|---|---|---|
| provider | string | yes | One of the provider values above |
| name | string | yes | Label, up to 120 characters |
| api_key | string | yes | The provider API key (for LiveKit, the API secret) |
| settings | object | no | Provider-specific settings. LiveKit needs livekit_api_key, livekit_url, and livekit_sip_host; ElevenLabs and Retell accept a webhook signing secret (elevenlabs_webhook_secret, retell_webhook_secret). See each provider guide. |
201 Created:
{
"data": {
"id": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"tenant_id": "3c9d2f4e-7b1a-4e8c-9d0f-1a2b3c4d5e6f",
"provider": "vapi",
"name": "Support agents",
"recording_enabled": true,
"max_concurrent_calls": 5,
"max_calls_per_minute": 30,
"settings": {},
"status": "active",
"webhook_url": "https://api.tryvox.io/v1/ai/webhooks/vapi/1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d?s=<secret>",
"created_at": "2026-10-30T10:00:00Z",
"updated_at": "2026-10-30T10:00:00Z"
}
}webhook_url is where the provider posts call reports back to TryVox, and TryVox configures it on the provider for you. Its s parameter is a secret — don't share the URL. New integrations default to recording_enabled: true, max_concurrent_calls: 5, and max_calls_per_minute: 30.
Update an integration
PATCH accepts any of name, api_key, settings, status, recording_enabled, max_concurrent_calls, max_calls_per_minute, and monthly_spend_cap_paise (send 0 to clear the cap). Only the fields you send change.
Disconnect
DELETE removes the integration and asks the provider to release every number bound to it. The response is {"data": {"deleted": true}}; if the provider could not release some numbers, it lists them in numbers_to_remove with a warning — remove them in the provider's dashboard. See Orphaned numbers.
Bindings
A binding connects one TryVox number to one agent. Binding a number provisions everything on the provider's side (SIP trunk, number import, agent assignment).
| Method | Path | Purpose |
|---|---|---|
POST | /v1/ai/integrations/{id}/bindings | Bind a number |
GET | /v1/ai/integrations/{id}/bindings | List an integration's bindings |
PATCH | /v1/ai/bindings/{binding_id} | Change the agent, outbound preference, inbound answering, or humans-first ringing |
DELETE | /v1/ai/bindings/{binding_id} | Unbind and release the number at the provider |
Bind a number
curl -X POST https://api.tryvox.io/v1/ai/integrations/$INTEGRATION_ID/bindings \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{
"tryvox_e164": "+918045671234",
"provider_agent_id": "<agent-id>"
}'| Field | Type | Required | Description |
|---|---|---|---|
| tryvox_e164 | string | yes | A TryVox number your account owns |
| provider_agent_id | string | yes | The agent's ID at the provider |
| label | string | no | Your label |
| country | string | no | Country of the number |
201 Created:
{
"data": {
"id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
"integration_id": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"tryvox_e164": "+918045671234",
"provider_agent_id": "<agent-id>",
"sip_uri": "sip:<agent-id>@sip.vapi.ai",
"is_preferred_outbound": true,
"inbound_enabled": true,
"created_at": "2026-10-30T10:05:00Z"
}
}Update a binding
| Field | Type | Description |
|---|---|---|
| provider_agent_id | string | Switch the number to a different agent |
| is_preferred_outbound | boolean | Use this number by default for Start a Call. Setting it clears the flag on the integration's other bindings. |
| inbound_enabled | boolean | false makes the binding outbound-only: inbound calls to the number skip the agent and go to the number's voice application |
| humans_first_numbers | string | Comma-separated E.164 numbers to ring before the agent answers. "" turns it off. |
| humans_first_ring_seconds | integer | How long the humans-first numbers ring |
| humans_first_strategy | string | sequential (default), random, or simultaneous |
Start a Call
Have the agent bound to one of your numbers call someone.
POST /v1/ai/integrations/{id}/callscurl -X POST https://api.tryvox.io/v1/ai/integrations/$INTEGRATION_ID/calls \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{
"to": "+919812345678",
"dynamic_variables": { "name": "Asha", "due_date": "5 November" },
"client_ref": "invoice-4411"
}'| Field | Type | Required | Description |
|---|---|---|---|
| to | string | yes | Destination in E.164 |
| from | string | no | One of the integration's bound numbers. Default: the binding marked is_preferred_outbound, else the first binding. |
| agent_id | string | no | Use this agent instead of the one bound to the number |
| dynamic_variables | object | no | String key/value pairs passed to the agent for its prompt (e.g. {{name}}). Delivered as Vapi variable values, ElevenLabs dynamic variables, Bolna user data, or LiveKit dispatch metadata. |
| client_ref | string | no | Your own reference. Stored on the call and returned on every read of it, and passed to the agent alongside dynamic_variables. |
201 Created (this response is not wrapped in data):
{
"conversation_id": "<conversation-id>",
"integration_id": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"provider_call_id": "<provider-call-id>",
"client_ref": "invoice-4411",
"from_number": "+918045671234",
"to_number": "+919812345678",
"status": "initiated",
"started_at": "2026-10-30T11:00:00Z",
"direction": "outbound"
}Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_BODY / INVALID_ID | to missing, malformed body, or bad integration ID |
| 400 | NO_BINDING | The integration has no bound number, or from isn't one of them |
| 400 | UNKNOWN_PROVIDER | The integration's provider isn't supported |
| 404 | NOT_FOUND | No such integration on your account |
| 429 | RATE_LIMITED | The integration's max_calls_per_minute or concurrency limit is reached — retry later |
| 501 | NOT_SUPPORTED | The provider has no API-initiated outbound (Retell) |
| 502 | PROVIDER_AUTH | The provider rejected the stored API key — update it |
| 502 | PROVIDER_ERROR | The provider rejected the call; the message carries its reason |
4xx (except 429) will not succeed on retry. 429 and 5xx may.
Call History
Get one call
GET /v1/ai/calls/{conversation_id}Returns the call object (not wrapped in data) — the fields above plus, once the call ends, duration, hangup_cause, error, transcript, analysis, recording_url, and ended_at. Poll it to follow a call you started.
List calls
GET /v1/ai/calls| Parameter | Description |
|---|---|
| integration_id | Only this integration (UUID) |
| status | initiated, ringing, in_progress, completed, or failed |
| direction | inbound or outbound |
| agent_id | Only this agent |
| search | Free-text search |
| from, to | Date range, YYYY-MM-DD. Send both or neither. |
| limit | Page size |
| cursor | next_cursor from the previous page |
The response nests the page inside data:
{
"data": {
"data": [
{
"conversation_id": "<conversation-id>",
"integration_id": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d",
"integration_name": "Support agents",
"provider": "vapi",
"client_ref": "invoice-4411",
"direction": "outbound",
"from_number": "+918045671234",
"to_number": "+919812345678",
"status": "completed",
"duration_seconds": 94,
"started_at": "2026-10-30T11:00:00Z",
"has_transcript": true,
"has_analysis": false,
"outcome": "answered",
"reason_label": "Caller hung up"
}
],
"next_cursor": "<cursor>"
}
}outcome is answered, no_answer, busy, failed, or in_progress. next_cursor is absent on the last page.
Stats
GET /v1/ai/stats?from=2026-10-01&to=2026-10-30Per-integration and per-agent totals: conversations, completed, failed, in_flight, answer_rate, avg_seconds, total_seconds, last_call_at, lifetime counts, and binding_count. Without from/to it covers the last 7 days.
Orphaned Numbers
If a provider could not release a number when you unbound it or deleted the integration, the number stays registered there and can't be bound again until it is released.
| Method | Path | Purpose |
|---|---|---|
GET | /v1/ai/orphaned-numbers | Numbers TryVox could not release, with last_error, attempts, and retryable |
POST | /v1/ai/orphaned-numbers/{id}/retry | Try the release again |