Skip to main content
POST
Send a visitor message to a chat session and receive an AI response. This endpoint is used by the embeddable chat widget.

Request Body

string
required
The public widget key from your dashboard.
string
required
The visitor’s message content.
string
Existing chat session ID. Omit to create a new session.
string
Unique visitor identifier (e.g., from localStorage UUID).
string
Visitor’s name (if collected).
string
Visitor’s email (if collected).
string
The URL of the page where the chat was initiated.

Response

string
The chat session ID (use for subsequent messages).
string
The AI agent’s response message.
string
Unique identifier for the AI response message.

Real-time Updates

Chat messages are delivered in real-time via Supabase Realtime. Subscribe to the chat_messages table for instant updates: