Skip to main content

Website Widget reference

Contract identity

ItemValue
Public contractqanivo.widget.public-api
Version1.0
Base path/api/integrations/v1/widget
Installation identitypublicSiteKey / siteKey
Session accessShort-lived origin- and audience-bound Bearer grant
Browser version headerX-Qanivo-Widget-Version: 1.0
Side-effect keyIdempotency-Key
SSE resumeLast-Event-ID plus bounded afterSequence

Route map

All paths are relative to the base path. Session/action routes require the access grant and matching allowed origin unless noted.

MethodPathPurpose / status
GET/config/{publicSiteKey}Safe public bootstrap/configuration
POST/sessionsCreate a visitor session
POST/sessions/renewRenew eligible session grant
POST/sessions/identifyAssociate verified visitor identity
DELETE/sessions/identifyRemove visitor identity
POST/forms/pre-chatAuthority target; not exposed by the current package/controller surface
POST/forms/offlineAuthority target; not exposed by the current package/controller surface
POST/context/pageReport minimized page context
POST/typingPublish typing state
POST/messagesAccept one idempotent message operation
GET/messages?afterSequence=...Read bounded message history
POST/messages/{clientOperationId}/retryAuthority target; current package retries POST /messages with the original idempotency key
GET/events?afterSequence=...Open/resume SSE events
POST/commands/navigation/{commandId}/acknowledgementsAcknowledge a navigation request
POST/commands/screenshots/{requestId}/acknowledgementsRecord screenshot consent outcome
POST/commands/screenshots/{requestId}/uploadUpload a consented screenshot
POST/sessions/closeClose panel or end visitor continuity

Common headers and errors

Browser requests include an allowed Origin and the contract-version header. Use Authorization: Bearer <YOUR_ACCESS_GRANT> only for scoped session routes. Use Idempotency-Key: <YOUR_OPERATION_ID> for side effects. Do not send grants or sensitive values in query parameters.

Safe errors expose a stable code, retryable, terminal, optional retryAfter, and safe correlationId. HTTP 429 may include Retry-After. Unknown request fields on security-sensitive/command routes are rejected; unknown informational event types are compatible only where the declared policy allows them.

Package surface

The framework-independent package exports createQanivoWidget, WIDGET_PUBLIC_API_PREFIX, and WIDGET_PUBLIC_API_VERSION. The instance provides mounting, launcher control, identity/reset operations, page-context updates, event subscriptions, and bounded message/form/media behavior. Refer to the installed package’s TypeScript declarations for the exact event and option types.

The canonical source references for this guide are qanivo-widget/SERVER_CONTRACTS.md, qanivo-widget/README.md, and the public Widget controller/contract implementation recorded in the repository crosswalk.