Chat Widget
Send Chat Message
Send a message to a chat widget session
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
The public widget key from your dashboard.
The visitor’s message content.
Existing chat session ID. Omit to create a new session.
Unique visitor identifier (e.g., from localStorage UUID).
Visitor’s name (if collected).
Visitor’s email (if collected).
The URL of the page where the chat was initiated.
Response
The chat session ID (use for subsequent messages).
The AI agent’s response message.
Unique identifier for the AI response message.
Real-time Updates
Chat messages are delivered in real-time via Supabase Realtime. Subscribe to thechat_messages table for instant updates: