Skip to main content
POST
Create a web session token

Authorizations

Authorization
string
header
required

Project API key (sk_api_…).

Path Parameters

realtimeAssistantId
string<uuid>
required

Body

application/json
participantName
string
required

The LiveKit participant identity the client joins under. Stored on the session record as participantIdentity.

Minimum string length: 1
roomName
string

Cosmetic prefix for the generated room name, truncated to its first 15 characters. Overrides the assistant's config.session.roomPrefix; with neither set the prefix is web.

assistantVersion
default:prod

Which version of the assistant runs. prod is the published version, or the draft before the first publish. draft tries unpublished edits on a real conversation. A number runs that exact published version, and one never published is a 404. Send a number as a JSON number, not a string.

Available options:
prod,
draft
Example:

"draft"

variables
object

Facts about the person on this session. They reach the model as a caller record and come back verbatim on every session read. Same limits as on a call. The rendered record rides in the returned token, so the browser can read it. Keep secrets out.

additionalInstructions
string

Appended to the assistant's instructions for this session only. It rides in the returned token, so the browser can read it. Keep secrets out.

Maximum string length: 2000

Response

The join token.

token
string

LiveKit access token. Hand it to a LiveKit client SDK along with wsUrl.

wsUrl
string<uri>

LiveKit WebSocket URL the client connects to.

roomName
string

The room this token opens. Server-generated — treat it as opaque.