Get a short-lived token for opening the chat socket as yourself
POST /Platform/chat/stream-token
Get a short-lived token for opening the chat socket as yourself.
For a browser host that holds an access key but is not on a Hilus
origin (the Chrome extension's side panel), so it cannot use the
session cookie and must not put the key in a socket URL, which access
logs record. Call this with the key in the Authorization header,
then open the chat stream socket with ?token= set to the result.
The token opens that socket only, as you and in your organization,
within a minute; an open socket is not cut off when it expires, and
each new connection needs a new token. The chat keeps the key's
limits: a key limited to some routes opens the socket only if they
include it, and its agent can use only those routes.
Body parameters
entry: optional "browser_extension". The organization's entry point the chat comes in through, kept in the token so the server decides it, not the socket URL.browser_extension: the organization's browser extension, whose routing picks the agent that answers you (the socket'sagent_idis then not used), and which refuses you while it is turned off. Omit for a chat with the agent the socket names.tab_work: optional bool. Whether this client can work in the person's browser tab. False: the tab tools are not offered in this chat.
Returns
ChatStreamToken
token: str. Pass as?token=when opening the chat stream socket.expires_in_seconds: int. Seconds left to open the socket with it; an open socket stays open.
Example request
curl -X POST "https://api.hilus.ai/Platform/chat/stream-token" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'