Skip to content

Send a message to a Kai thread (SSE)

POST
/api/support/threads/{id}/messages/
curl --request POST \
--url http://localhost:8000/api/support/threads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/messages/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "content": "example", "attachment_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

GET returns the persisted conversation, oldest first.

POST sends one user turn ({content}) and streams the assistant answer as text/event-stream with the same frame contract as /api/support/ask/ (metatoken* → citationsdone); both turns are persisted server-side, so history is never re-sent by the client. An invalid body yields a single event: error frame with HTTP 400. POST shares the paid-LLM rate limit with /ask/; exceeding it returns 429.

id
required
string format: uuid
lang
string

UI language (en / ru / es, default en) — localises attachment snapshot labels on create and retrieval + answers on message send.

Body of POST /api/support/threads/{id}/messages/ — one user turn; history is server-owned (unlike the legacy /ask/ full-transcript body). attachment_ids binds previously-uploaded pending files (composer chips) to this turn.

object
content
required
string
>= 1 characters <= 4000 characters
attachment_ids
Array<string>
<= 5 items
Examplegenerated
{
"content": "example",
"attachment_ids": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

text/event-stream of support-answer frames (see description).

Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examplegenerated
{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examplegenerated
{
"detail": "example"
}
Media typeapplication/json
object
detail
required

Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).

string
Examplegenerated
{
"detail": "example"
}
Media typeapplication/json
object
detail
required

429 — rate limit exceeded. Honour the Retry-After response header (seconds to wait) before retrying; it is sent on every 429.

string
Examplegenerated
{
"detail": "example"
}