Start Public Call
POST
/public/v1/voice/sessions
const url = 'https://api.nuacem.dev/voice-gw/public/v1/voice/sessions';const options = { method: 'POST', headers: {'X-VoiceCX-Key': 'example', 'Content-Type': 'application/json'}, body: '{"agentId":"example","useCaseId":"example","language":"example","visitorId":"example","userId":"example","userHash":"example","chatSessionId":"example","chatToken":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.nuacem.dev/voice-gw/public/v1/voice/sessions \ --header 'Content-Type: application/json' \ --header 'X-VoiceCX-Key: example' \ --data '{ "agentId": "example", "useCaseId": "example", "language": "example", "visitorId": "example", "userId": "example", "userHash": "example", "chatSessionId": "example", "chatToken": "example" }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
PublicVoiceRequest
object
Example generated
{ "agentId": "example", "useCaseId": "example", "language": "example", "visitorId": "example", "userId": "example", "userHash": "example", "chatSessionId": "example", "chatToken": "example"}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
PublicVoiceResponse
object
sessionId
required
Sessionid
string
livekitUrl
required
Livekiturl
string
token
required
Token
string
visitorId
required
Visitorid
string
language
required
Language
string
silenceCheckSeconds
required
Silencecheckseconds
integer
silenceEndSeconds
required
Silenceendseconds
integer
Example generated
{ "sessionId": "example", "livekitUrl": "example", "token": "example", "visitorId": "example", "language": "example", "maxDurationSeconds": 1, "silenceCheckSeconds": 1, "silenceEndSeconds": 1, "callToken": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}