Create Call
Start a new voice call — web session or outbound phone call.
POST
/v2/callsCreate a new voice call.
No parameters for this endpoint.
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | No | web | Call type: web (browser) or outbound (phone) |
agent_id | string | Yes | — | Agent public ID (ag_*) |
phone_number_id | integer | Outbound only | — | Phone number to call from |
customer.number | string | Outbound only | — | Customer phone (E.164) |
customer.name | string | No | — | Customer display name |
voice_config | object | No | Agent default | Override STT/TTS config |
Web Call
Creates a browser-based voice session. Returns a LiveKit token for the client to connect.
{
"type": "web",
"agent_id": "ag_5d2678fd_e556",
"voice_config": {
"stt_provider": "deepgram",
"tts_provider": "cartesia"
}
}Response 201
{
"id": "demo-abc123",
"type": "web",
"status": "active",
"agent_id": "ag_5d2678fd_e556",
"token": "eyJhbGciOiJIUzI1...",
"livekit_url": "wss://api.thinnest.ai/livekit",
"room_name": "voice-ag_5d2678fd-abc123",
"expires_in": 300
}Outbound Phone Call
Initiates an outbound phone call via Twilio/Vobiz SIP.
{
"type": "outbound",
"agent_id": "ag_5d2678fd_e556",
"phone_number_id": 12,
"customer": {
"number": "+919876543210",
"name": "Rahul"
}
}Response 201
{
"id": 78,
"type": "outbound",
"status": "connecting",
"agent_id": "ag_5d2678fd_e556",
"customer": {
"number": "+919876543210",
"name": "Rahul"
},
"room_name": "voice-ag_5d2678fd-def456"
}Errors
| Code | Description |
|---|---|
402 | Insufficient balance |
422 | Missing agent_id or invalid type |
429 | Rate limit exceeded (5 calls/min) |