ApiEmbed widget
Opens a live session for a web visitor from a publishable embed key.
Validates the key + embedding origin, provisions/reuses the anonymous visitor, and returns the session id + short-lived session token (the bearer credential for every other call) plus the agent's presentation.
The embed key, optional visitor key, and embedding origin.
embedKey?string|null
The publishable embed key from the snippet.
visitorKey?string|null
Stable per-visitor key the client persists (localStorage) for return-visit continuity. Optional — when omitted a fresh visitor is minted and returned.
origin?string|null
The embedding page's origin. The iframe is served from Fruxon's origin, so
the request's own Origin header is Fruxon's — the client reports the parent
site here (e.g. from ancestorOrigins). Falls back to the Origin /
Referer header when absent.
[key: string]?never
Response Body
curl -X POST "https://api.fruxon.com/v1/embed/sessions" \ -H "Content-Type: application/json" \ -d '{}'{
"sessionId": "string",
"sessionToken": "string",
"expiresInSeconds": 0,
"visitorKey": "string",
"agent": {
"displayName": "string",
"avatarFileId": "string"
},
"greeting": "string",
"suggestedPrompts": [
"string"
],
"themeJson": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}