Create a pre-signed widget session

Generates a pre-signed widget session so the embedded widget (starya-widget) can open
already authenticated as an existing client — linked to that client's existing chat —
instead of creating a new anonymous user.

This is a server-to-server call authenticated by the enterprise api-key. The client is
resolved by phone; when phone is omitted or does not match any client, an anonymous
user/chat is created (anonymous fallback, same behavior as the widget's register).

The response returns only a sessionId (never a raw JWT). The host hands it to the widget,
which re-issues its 1h JWT via POST /auth/widget/session/use with its own
x-api-key/x-site-id — so the sessionId alone is not usable outside the allowed site.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

Site ID of the tenant's widget API key (the same one used by the embedded widget)

string
required

ID of the agent the session will be opened with

string

E.164 phone number of an already-registered client used to link the session to the client's existing user and chat. When omitted or not matching any client, an anonymous user/chat is created (anonymous fallback).

string

Name used only for the anonymous fallback

string

Email used only for the anonymous fallback

metadata
object

Metadata used only for the anonymous fallback

Responses

400

Bad Request

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json