Request Body
Call type: web (browser) or outbound (phone)
Agent public ID (ag_*)
Phone number to call from
Customer phone (E.164)
Customer display name
Override STT/TTS config
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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"
}'
import requests
url = "https://api.thinnest.ai/v2/calls"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/v2/calls", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/v2/calls", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"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
}
Start a new voice call — web session or outbound phone call.
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"
}'
import requests
url = "https://api.thinnest.ai/v2/calls"
headers = {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
}
payload = {
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch("https://api.thinnest.ai/v2/calls", {
method: "POST",
headers: {
"Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}),
});
const data = await response.json();
console.log(data);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"type": "web",
"agent_id": "ag_5d2678fd_e556"
}`)
req, _ := http.NewRequest("POST", "https://api.thinnest.ai/v2/calls", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"type": "web",
"agent_id": "ag_5d2678fd_e556",
"voice_config": {
"stt_provider": "deepgram",
"tts_provider": "cartesia"
}
}
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
}
{
"type": "outbound",
"agent_id": "ag_5d2678fd_e556",
"phone_number_id": 12,
"customer": {
"number": "+919876543210",
"name": "Rahul"
}
}
201{
"id": 78,
"type": "outbound",
"status": "connecting",
"agent_id": "ag_5d2678fd_e556",
"customer": {
"number": "+919876543210",
"name": "Rahul"
},
"room_name": "voice-ag_5d2678fd-def456"
}
| Code | Description |
|---|---|
402 | Insufficient balance |
422 | Missing agent_id or invalid type |
429 | Rate limit exceeded (5 calls/min) |
