Create a session
Creates a session and returns its token.
The token is returned here and in GET /v2/sessions/{id}.
List responses do not include it.
Repeating the call with the same client_reference_id creates an independent session.
Each session has its own id, token and lifetime.
| Request Body — REQUIRED |
|---|
intent string — REQUIREDPossible values: [ Product the session token is valid for:
A token presented to a different product is refused. |
connection_type stringPossible values: [ Transport the end user will connect with.
|
expires_in_seconds integerPossible values: 60 ≤ value ≤ 86400 Connect window: how long after creation the token can open a new stream. Streams already running are not affected when the window closes. To extend, issue a new session. |
max_session_duration_seconds integerPossible values: 60 ≤ value ≤ 18000 Maximum duration of any single stream opened with this token, counted from that stream's own start. The stream is closed when it is reached. When omitted, streams are limited only by your account limits. |
single_use boolean
|
client_reference_id stringPossible values: length ≤ 256 Your own identifier for the customer, device or order this session belongs to. Stored as is, not unique, and used to filter sessions and usage. Set it from your server; end users cannot change it. |
subscriber_count integerPossible values: value ≤ 100 Number of listener tokens to issue alongside the publisher token.
Available for |
| Responses | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
201Session created.
| |||||||||||||||||||
401 | |||||||||||||||||||
402 | |||||||||||||||||||
403 | |||||||||||||||||||
422 | |||||||||||||||||||
424 | |||||||||||||||||||
429 | |||||||||||||||||||
500 |