Create Session Token

Creates a short-lived session token that can be used to authenticate WebSocket connections. Session tokens are useful for client-side applications where you don’t want to expose your API key.

Authentication

AuthorizationBearer
Bearer authentication header of the form `Bearer <PHONIC_API_KEY>`. Manage your API keys [here](https://phonic.co/api-keys).

Request

This endpoint expects an object.
ttl_secondsintegerOptional60-3600Defaults to 300

Time-to-live for the session token in seconds.

conversation_idslist of stringsOptional
Restricts the token to these conversations. A restricted token can read only their live audio and transcript, and cannot open the STS WebSocket or create an STS session. Omit it and the token can read any live conversation in the org. Pass it whenever the token will reach an end user's browser.

Response

Success response
session_tokenstring
The session token to use for authentication.
expires_atstringformat: "date-time"
When the session token expires.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error