Sessions and authentication
Before opening a WebSocket, you obtain an access token and create a session.
Obtain an access token
Exchange your connector token for a short-lived JWT access token.
POST /api/v1/access-token
Headers
Request body
Response — 200 OK
Use this token in two places:
- As a
Bearertoken in theAuthorizationheader for Create session - As the
access_tokenquery parameter when connecting the WebSocket
Treat the access token as sensitive. Do not log it, store it in localStorage, or expose it to third-party scripts. Always connect over wss:// (TLS).
Create session
A session represents one conversation. Create a session before opening a WebSocket.
POST /api/v1/sessions
Headers
Request body (optional)
The request body is optional — if omitted, streaming_enabled defaults to false.
Response — 200 OK
Keep the session_id — you need it to open the WebSocket and to reconnect if the connection drops.
Sessions expire after roughly 10 minutes of inactivity. After expiry, create a new session — you cannot resume an expired session.

