Skip to main content

Overview

The Widget API powers the embeddable chat widget. All endpoints are public (no authentication required) but rate-limited and scoped to individual agents.

Endpoints

Create or resume a session

string
required
The agent’s unique identifier.
Action: init Creates a new chat session or resumes an existing one.
Response:
The visitor token is persisted in the browser’s localStorage as setter_visitor_{agentId}. Returning visitors send their token to resume the previous conversation.

Send a message

Action: send
Response:
After sending, the client polls for the AI response.

Poll for messages

Returns the latest messages in the conversation. The widget uses exponential backoff polling (500ms → 4s, max 30 seconds) to wait for the AI response. Response:

Get widget config

Returns the widget’s display configuration. Response:

Rate limits

429 response — The widget displays a “sending too quickly” message. Timeout — If the AI doesn’t respond within 30 seconds, a “Sorry, I took too long” fallback is shown.

Lead limits

When an organisation exceeds its monthly lead limit, new sessions are created with ai_enabled: false. The agent won’t respond automatically. The conversation is still created so the lead’s message is captured.