Skip to main content
curl -X POST https://api.thinnest.ai/v2/calls \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "web",
  "agent_id": "ag_5d2678fd_e556"
}'

Request Body

type
string
default:"web"
Call type: web (browser) or outbound (phone)
agent_id
string
required
Agent public ID (ag_*)
phone_number_id
integer
Phone number to call from
customer.number
string
Customer phone (E.164)
customer.name
string
Customer display name
voice_config
object
default:"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

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