/v1/projects/{projectId}/web-sessions/agents (POST)
POST
/v1/projects/{projectId}/web-sessions/agents
const url = 'https://service.testing.nairon.cloud/v1/projects/example/web-sessions/agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","conversationId":"example","channel":"widget","scopes":["voice"],"allowedOrigins":[]}'};
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://service.testing.nairon.cloud/v1/projects/example/web-sessions/agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "conversationId": "example", "channel": "widget", "scopes": [ "voice" ], "allowedOrigins": [] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string format: cuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
conversationId
required
string format: cuid
channel
string
scopes
required
Array<string>
allowedOrigins
Array<string>
Responses
Section titled “Responses”Default Response
Media typeapplication/json
object
id
required
string format: cuid
projectId
required
string format: cuid
name
required
string
channel
required
string
scopes
required
Array<string>
allowedOrigins
required
Array<string>
conversationId
required
string format: cuid
status
required
string
Example
{ "channel": "widget", "scopes": [ "voice" ], "status": "active"}