Provision an AI Widget visitor session
Public, unauthenticated endpoint called by the embedded ethora-ai-chat-widget on mount. Mints (or resumes) an anonymous visitor user in ejabberd, creates a persistent MUC room, pre-affiliates the visitor and the App's AI bot as members, and returns the credentials needed for the widget to SASL-bind and join.
Visitor JIDs follow the convention ${appId}_widget-<uuid> so mod_ethora's per-app prefix guard accepts them as members of the room. Rooms follow ${appId}_<roomUuid> and are tagged in the platform DB as chats.type='widget'.
The endpoint is rate-limited per IP (30/minute) since it's reachable from any browser without auth. It validates that the App exists and has an AI bot configured before provisioning anything.
Request
- Base URL: https://api.chat.ethora.com
- URL: https://api.chat.ethora.com/v2/widget/sessions
- Auth: HTTP bearer
Request body
Response
{
visitor: {
xmppUsername: string, // bare localpart, e.g. "${appId}_widget-<uuid>"
xmppPassword: string,
uuid: string,
jid?: string // fully-qualified, "<localpart>@<host>"
},
room: {
name: string, // bare room name, e.g. "${appId}_<roomUuid>"
chatId: string, // Mongo _id of the chats row
jid?: string // fully-qualified, "<name>@conference.<host>"
},
bot: {
xmppUsername: string,
jid?: string
},
xmpp?: {
host: string, // ejabberd host, e.g. "xmpp.example.com"
service: string, // MUC service, e.g. "conference.xmpp.example.com"
wsUrl: string // canonical WS URL, e.g. "wss://xmpp.example.com/ws"
}
}
Changes
No recorded changes to this operation across all 1 revision of this API.