Skip to main content
POST
/
v1
/
session-token
Generate session token
curl --request POST \
  --url https://api.vatel.ai/v1/session-token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "first_message": "<string>",
  "prompt": "<string>",
  "chat": true,
  "variables": [
    {
      "key": "<string>",
      "value": "<string>"
    }
  ]
}
'
{
  "token": "<string>",
  "room": "<string>",
  "identity": "<string>",
  "url": "<string>",
  "webrtc_token": "<string>"
}

Authorizations

Authorization
string
header
required

Send your organization API key as Authorization: Bearer <key>.

Body

application/json
agent_id
string<uuid>
required

UUID of the agent that will run this voice session.

version_id
string<uuid>

Agent version to use. If omitted, the active published version is used.

chat_id
string<uuid>

Existing chat to continue in this session.

transport
enum<string>

websocket for voice over the platform WebSocket API (default). webrtc for WebRTC; the response includes room connection details.

Available options:
websocket,
webrtc
first_message
string

Opening line the agent uses for this session.

prompt
string

System instructions for the agent for this session.

chat
boolean

Also allow access to the chat API for this session.

variables
object[]

Custom key-value data available to the agent in this session.

Response

Session credentials.

Connection credentials for the session.

token
string
required

Credential for voice WebSocket, WebRTC setup, or chat API as applicable.

room
string

Room name for WebRTC. Returned when transport is webrtc.

identity
string

Your participant id for WebRTC. Returned when transport is webrtc.

url
string

Media server URL for WebRTC. Returned when transport is webrtc.

webrtc_token
string

Credential to join the WebRTC media room. Returned when transport is webrtc.