Voice
Voice
Live voice sessions, call history, voice engines and phone line requests.
/voice/live/sessionCreate a live voice session
Creates a short-lived voice session between the user and one of their assistants, scoped to a chat or task. When you pass neither, a new chat is created. Connect your client to `websocketUrl` with `sessionToken`.
Request body
Responses
Request
curl 'https://api.agnt.ai/voice/live/session' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"assistantId": "6660c4a1f2e3b7d8a9c01234",
"chatId": "6660c4a1f2e3b7d8a9c01234",
"taskId": "6660c4a1f2e3b7d8a9c01234"
}'Response
{
"ok": true,
"provider": "provider",
"sessionId": "3f6c2a9e-8b41-4d7a-9c15-2e7b0d4a6f18",
"websocketUrl": "wss://voice.agnt.ai/live"
}/voice/live/cancelCancel a live voice session
Cancels a live voice session the user created that has not connected yet. Returns `404` with `invalid_session` when there is no such session.
Request body
Responses
truetrueRequest
curl 'https://api.agnt.ai/voice/live/cancel' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "6660c4a1f2e3b7d8a9c01234"
}'Response
{
"ok": true,
"cancelled": true
}/voice/providersList voice engines
Returns the voice engines configured for your app, each with its voices and default voice. `available` says whether an engine can take calls now.
Responses
malefemaleotherRequest
curl 'https://api.agnt.ai/voice/providers' \
-H "Authorization: Bearer ak_live_..."Response
{
"ok": true,
"providers": [
{
"id": "6660c4a1f2e3b7d8a9c01234",
"name": "Ava",
"enabled": true,
"available": true
}
]
}/voice/callsList calls
Returns the user's calls, newest first: calls placed for them and each call their assistant made on their tasks. Requires `X-User-Email`.
Query parameters
Responses
directtaskuserinternalthird_partyRequest
curl 'https://api.agnt.ai/voice/calls' \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"calls": [
{
"source": "direct",
"id": "6660c4a1f2e3b7d8a9c01234",
"taskId": "6660c4a1f2e3b7d8a9c01234",
"taskTitle": "tasktitle"
}
]
}/phone-line-requestsCreate a phone line request
Requests phone numbers for the user's primary assistant. When the numbers are ready, they appear on the assistant under `channels`.
Request body
Responses
pendingfulfilleddismissedRequest
curl 'https://api.agnt.ai/phone-line-requests' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"requestedChannels": {
"imessage": true,
"sms": true,
"whatsapp": true,
"voice": true
},
"notes": "notes"
}'Response
{
"ok": true,
"request": {
"id": "6660c4a1f2e3b7d8a9c01234",
"assistant": "assistant",
"requestedChannels": {
"imessage": true,
"sms": true,
"whatsapp": true,
"voice": true
},
"notes": "notes"
}
}/phone-line-requests/mineRetrieve the latest phone line request
Returns the user's most recent phone line request for their primary assistant, or `request: null` when there is none.
Responses
pendingfulfilleddismissedRequest
curl 'https://api.agnt.ai/phone-line-requests/mine' \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"request": {
"id": "6660c4a1f2e3b7d8a9c01234",
"assistant": "assistant",
"requestedChannels": {
"imessage": true,
"sms": true,
"whatsapp": true,
"voice": true
},
"notes": "notes"
}
}