curl --request POST \
--url 'https://api.example.com/api/threads/{id}/messages' \
--header 'x-widget-token: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": "Two-person tent, green — replacement for damaged pole set.",
"stream": true,
"provider": "string"
}'
{
"ok": true,
"reply": "string",
"threadId": "string",
"suggestions": [
"string"
],
"provider": "string",
"model": "string",
"toolCalls": [
{}
],
"sources": [
{
"title": "Replacement tent pole set",
"url": "https://example.com/webhooks/stateset"
}
],
"outcomes": [
{
"name": "Two-Person Tent",
"resourceType": "string",
"resourceId": "string",
"quantity": 2,
"amount": 49,
"revenue": 49,
"currency": "USD"
}
],
"type": "standard",
"content": {
"headline": "Replacement tent pole set",
"products": [
{
"id": null,
"title": null,
"price": null
}
],
"orders": [
{}
]
}
}
Post a message to a thread
Same streaming contract as /api/chat when stream is true.
POST
/
api
/
threads
/
{id}
/
messages
curl --request POST \
--url 'https://api.example.com/api/threads/{id}/messages' \
--header 'x-widget-token: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": "Two-person tent, green — replacement for damaged pole set.",
"stream": true,
"provider": "string"
}'
{
"ok": true,
"reply": "string",
"threadId": "string",
"suggestions": [
"string"
],
"provider": "string",
"model": "string",
"toolCalls": [
{}
],
"sources": [
{
"title": "Replacement tent pole set",
"url": "https://example.com/webhooks/stateset"
}
],
"outcomes": [
{
"name": "Two-Person Tent",
"resourceType": "string",
"resourceId": "string",
"quantity": 2,
"amount": 49,
"revenue": 49,
"currency": "USD"
}
],
"type": "standard",
"content": {
"headline": "Replacement tent pole set",
"products": [
{
"id": null,
"title": null,
"price": null
}
],
"orders": [
{}
]
}
}
Same streaming contract as
/api/chat when stream is true.
Path parameters
string
required
Thread id
Request body
ThreadMessage
string
required
boolean
string
Response
ChatResponse
boolean
required
string
required
The assistant reply, rendered as markdown
string
string[]
string
string
object[]
Outcome[]
string
Rich message type:
product_cards or order_cardsobject
Status codes
| Code | Meaning |
|---|---|
200 | OK |
400 | Error |
401 | Error |
curl --request POST \
--url 'https://api.example.com/api/threads/{id}/messages' \
--header 'x-widget-token: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"message": "Two-person tent, green — replacement for damaged pole set.",
"stream": true,
"provider": "string"
}'
{
"ok": true,
"reply": "string",
"threadId": "string",
"suggestions": [
"string"
],
"provider": "string",
"model": "string",
"toolCalls": [
{}
],
"sources": [
{
"title": "Replacement tent pole set",
"url": "https://example.com/webhooks/stateset"
}
],
"outcomes": [
{
"name": "Two-Person Tent",
"resourceType": "string",
"resourceId": "string",
"quantity": 2,
"amount": 49,
"revenue": 49,
"currency": "USD"
}
],
"type": "standard",
"content": {
"headline": "Replacement tent pole set",
"products": [
{
"id": null,
"title": null,
"price": null
}
],
"orders": [
{}
]
}
}
Last modified on August 31, 2026