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",
  "transport": "websocket",
  "first_message": "<string>",
  "prompt": "<string>"
}
'
{
  "token": "<string>",
  "room": "<string>",
  "identity": "<string>",
  "url": "<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>

Optional published version UUID. When omitted, the server uses the agent's resolved active version.

transport
enum<string>

websocket: platform WebSocket session (default when omitted). webrtc: WebRTC media room; response adds room, identity, and url.

Available options:
websocket,
webrtc
first_message
string

Optional opening line override for this session (WebSocket session token and WebRTC JWT participant attributes when applicable).

prompt
string

Optional system prompt override for this session (WebSocket session parameters and WebRTC JWT participant attributes when applicable).

Response

Credential payload. Always includes token. For webrtc transport, the server also returns room, identity, and url.

With websocket transport, only token is set. With webrtc, token is the media-room access JWT (microphone subscribe and publish; participant attributes include agent_id and, when provided, version_id, prompt, and first_message), and room, identity, and url are server-assigned.

token
string
required

Token for the WebSocket or WebRTC client flow.

room
string

Media room name assigned by the server. Present only when transport was webrtc.

identity
string

Participant identity assigned by the server for the WebRTC session. Present only when transport was webrtc.

url
string

WebSocket URL of the media server. Present only when transport was webrtc.