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

Providerprovider valueInboundOutbound started by your agent in the providerOutbound via Start a Call
Vapivapi✅✅✅
ElevenLabs Conversational AIelevenlabs✅✅✅
Retellretell✅✅❌ returns 501 NOT_SUPPORTED
LiveKitlivekit✅✅✅
Bolnabolna✅✅✅

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.

MethodPathPurpose
POST/v1/ai/integrationsConnect a provider
GET/v1/ai/integrationsList 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}/testCheck the stored key still works
GET/v1/ai/integrations/{id}/agentsList the provider's agents
POST/v1/ai/integrations/{id}/agents/verifyCheck 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>"
  }'
FieldTypeRequiredDescription
providerstringyesOne of the provider values above
namestringyesLabel, up to 120 characters
api_keystringyesThe provider API key (for LiveKit, the API secret)
settingsobjectnoProvider-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).

MethodPathPurpose
POST/v1/ai/integrations/{id}/bindingsBind a number
GET/v1/ai/integrations/{id}/bindingsList 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>"
  }'
FieldTypeRequiredDescription
tryvox_e164stringyesA TryVox number your account owns
provider_agent_idstringyesThe agent's ID at the provider
labelstringnoYour label
countrystringnoCountry 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

FieldTypeDescription
provider_agent_idstringSwitch the number to a different agent
is_preferred_outboundbooleanUse this number by default for Start a Call. Setting it clears the flag on the integration's other bindings.
inbound_enabledbooleanfalse makes the binding outbound-only: inbound calls to the number skip the agent and go to the number's voice application
humans_first_numbersstringComma-separated E.164 numbers to ring before the agent answers. "" turns it off.
humans_first_ring_secondsintegerHow long the humans-first numbers ring
humans_first_strategystringsequential (default), random, or simultaneous

Start a Call

Have the agent bound to one of your numbers call someone.

POST /v1/ai/integrations/{id}/calls
curl -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"
  }'
FieldTypeRequiredDescription
tostringyesDestination in E.164
fromstringnoOne of the integration's bound numbers. Default: the binding marked is_preferred_outbound, else the first binding.
agent_idstringnoUse this agent instead of the one bound to the number
dynamic_variablesobjectnoString 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_refstringnoYour 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

StatusCodeMeaning
400INVALID_BODY / INVALID_IDto missing, malformed body, or bad integration ID
400NO_BINDINGThe integration has no bound number, or from isn't one of them
400UNKNOWN_PROVIDERThe integration's provider isn't supported
404NOT_FOUNDNo such integration on your account
429RATE_LIMITEDThe integration's max_calls_per_minute or concurrency limit is reached — retry later
501NOT_SUPPORTEDThe provider has no API-initiated outbound (Retell)
502PROVIDER_AUTHThe provider rejected the stored API key — update it
502PROVIDER_ERRORThe 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
ParameterDescription
integration_idOnly this integration (UUID)
statusinitiated, ringing, in_progress, completed, or failed
directioninbound or outbound
agent_idOnly this agent
searchFree-text search
from, toDate range, YYYY-MM-DD. Send both or neither.
limitPage size
cursornext_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-30

Per-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.

MethodPathPurpose
GET/v1/ai/orphaned-numbersNumbers TryVox could not release, with last_error, attempts, and retryable
POST/v1/ai/orphaned-numbers/{id}/retryTry the release again

On this page