Create Call

Start a new voice call — web session or outbound phone call.

POST/v2/calls

Create a new voice call.

No parameters for this endpoint.


Request Body

FieldTypeRequiredDefaultDescription
typestringNowebCall type: web (browser) or outbound (phone)
agent_idstringYesAgent public ID (ag_*)
phone_number_idintegerOutbound onlyPhone number to call from
customer.numberstringOutbound onlyCustomer phone (E.164)
customer.namestringNoCustomer display name
voice_configobjectNoAgent defaultOverride 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

CodeDescription
402Insufficient balance
422Missing agent_id or invalid type
429Rate limit exceeded (5 calls/min)

On this page