Send a message and get a reply
The one endpoint the widget requires. With stream: true, respond with Content-Type: text/event-stream, one JSON object per data: line (see the SseEvent shape…
POST
The one endpoint the widget requires. With
stream: true, respond with Content-Type: text/event-stream, one JSON object per data: line (see the SseEvent shape in the overview), and finish with data: [DONE]. Without it, respond with the JSON body below.
Request body
ChatRequest
string
Optional conversation title
string
required
User input text
object[]
object
{ department, customFields } from widget propsstring
Widget session identifier
string
Defaults to
chatstring
Existing thread id, if any
boolean
When true the server should stream SSE events and end with
[DONE]string
Optional override:
openai, anthropic or geministring
Optional org id, used to fetch rules and knowledge base
string
Optional agent id, used to fetch rules
string
Optional knowledge-base collection override
string
Optional KB API key override — avoid sending client-side in production
number
KB retrieval limit (default 3)
number
KB similarity threshold (default 0.5)
Response
ChatResponse
boolean
required
string
required
The assistant reply, rendered as markdown
string
string[]
string
string
object[]
object[]
Outcome[]
string
Rich message type:
product_cards or order_cardsobject
Payload for the rich message type