POST
Start a session

Authorizations

x-api-key
string
header
required

Organization API key generated in Dashboard → account menu → Developer API (dash.trainertwin.com/developer).

Body

application/json

deploymentKey or scenario is required; deploymentKey takes precedence.

userId
string
required
Example:

"user_123"

scenario
string
Pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]*$
Example:

"react-mock-interview"

deploymentKey
string

Public key of an active deployment; takes precedence over scenario.

mode
enum<string>
default:chat
Available options:
chat,
voice
documentId
string

Optional context document to attach to the session (an organization document or one uploaded by the learner).

idempotencyKey
string

Retry-safe key scoped to the deployment; reusing it returns the same active session instead of creating a new one.

Response

Session activated.

session
object
required
conversationToken
string

Chat-mode token for driving the session.

participantToken
string

Voice-mode LiveKit access token for joining room.

room
string

Voice-mode LiveKit room name.