Skip to main content
A web widget is the embeddable configuration that connects a published agent version to your website. The API has two parts: authenticated management endpoints under /core/web-widgets that you call from your backend to create and configure widgets, and unauthenticated public runtime endpoints under /core/public/web-widgets that the embedded widget calls from the browser to start conversations. For the product walkthrough and the embed snippet, see /web-widgets/overview. For domain restrictions, see /web-widgets/allowed-domains-and-security.

Authentication

The management endpoints require a token with the right scope. Use an org API key (ak_) or a user PAT (pat_):
Read endpoints accept either scope. Write endpoints (POST, PUT, DELETE, auto-brand) require web_widgets:manage.
The public runtime endpoints are unauthenticated and resolve the organization from the widget id in the path. They are meant to be called from the browser by the embedded widget. Never send a PAT, API key, or X-Anyreach-Org header from browser code.

Management endpoints

All paths below are prefixed with /core/web-widgets.

Widget object

Every read and write endpoint returns the widget object.

List widgets

GET /core/web-widgets Returns an array of widgets. All query parameters are optional.

Create a widget

POST /core/web-widgets The body sets the agent and version the widget runs. organization_id is taken from your token, not the body.
The widget runs whatever agent_version_id you give it. Point it at a published agent version so the embedded widget can dispatch real conversations. See /web-widgets/overview for how versions are published.

Update a widget

PUT /core/web-widgets/{id} Send only the fields you want to change. agent_id, agent_version_id, domains, published, and config are all optional and replace the stored value when present.

Delete a widget

DELETE /core/web-widgets/{id} Returns 204 No Content on success.

Auto-brand

POST /core/web-widgets/{id}/auto-brand Fetches brand data (colors, logos, and related assets) for a domain so you can pre-fill widget styling. The widget must exist. Returns the resolved brand object. Responds with 404 if no brand is found for the domain.

Public runtime endpoints

These power the embedded widget in the browser. They are unauthenticated: the organization is resolved from the widget id in the path, and the conversation channel is always WEBRTC. All paths are prefixed with /core/public/web-widgets.

Get widget config

GET /core/public/web-widgets/{id} Returns the same widget object as the management endpoints. The embedded widget uses it to render appearance and behavior.

Create or resume a conversation

POST /core/public/web-widgets/{id}/conversations Starts a new WEBRTC conversation, or resumes an existing one when conversation_id is set. The response carries the LiveKit connection_details the browser uses to join the call. When resuming, the conversation must belong to this widget or the request returns 403; an unknown conversation_id returns 404. The response is a JSON object:

List a visitor’s conversations

GET /core/public/web-widgets/{id}/conversations Lists conversations scoped to this widget. Defaults to the WEBRTC channel. All query parameters are optional.

Submit feedback

POST /core/public/web-widgets/{id}/conversations/{conversation_id}/feedback Stores post-conversation feedback on the conversation. The conversation must already exist and belong to the widget, and the widget must have a feedback form configured. Only keys that match the widget’s configured feedback-form field ids are stored; others are dropped. The endpoint enforces: Returns { "status": "ok" } on success. It returns 400 if the widget collects no feedback or no valid fields were submitted, and 413 if the payload is too large.

Web widgets

Configure and embed a widget on your site.

Allowed domains and security

Restrict which sites can embed and run a widget.