Create Conversation Token

Creates a short-lived conversation token scoped to a specific agent. Conversation tokens are useful for client-side applications that start a conversation with a single agent without exposing 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.
agent_idstringRequired
ID of the agent the conversation token is scoped to.
ttl_secondsintegerOptional30-60Defaults to 30

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

Response

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

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error