Create or resume a Kai thread
const url = 'http://localhost:8000/api/support/threads/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"product","title":"","subject_ref":{"kind":"session","subject_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","params":{"additionalProperty":"example"},"label":""},"attachment_refs":[{"kind":"session_metrics","subject_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","params":{"additionalProperty":"example"}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/support/threads/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "product", "title": "", "subject_ref": { "kind": "session", "subject_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "additionalProperty": "example" }, "label": "" }, "attachment_refs": [ { "kind": "session_metrics", "subject_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "additionalProperty": "example" } } ] }'Named, server-persisted Kai conversations, personal to the calling coach (never visible to teammates). A thread can be scoped to a subject — a session, one metric of a session, a video moment — and creating with the same subject_ref again RESUMES the existing thread (created: false) instead of duplicating it.
attachment_refs are typed references only: the server verifies the subject belongs to your team and builds an immutable data snapshot from the database — request bodies have no field for raw context content by design.
Feature-flagged: while support threads are disabled on the environment every route responds 404.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”UI language (en / ru / es, default en) — localises attachment snapshot labels on create and retrieval + answers on message send.
Request Body
Section titled “Request Body”Body of POST /api/support/threads/.
object
object
session- sessionmetric- metricsession_moment- session_momentsolution_run- solution_rundashboard_insight- dashboard_insightsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewpage- page
object
A typed context REFERENCE — never content. The server verifies team ownership and builds the snapshot from Postgres (Decision C), so this body has no field a client could smuggle numbers through.
object
session_metrics- session_metricsmetric- metricsession_moment- session_momentsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewsolution_run- solution_rundashboard_insight- dashboard_insight
object
Body of POST /api/support/threads/.
object
object
session- sessionmetric- metricsession_moment- session_momentsolution_run- solution_rundashboard_insight- dashboard_insightsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewpage- page
object
A typed context REFERENCE — never content. The server verifies team ownership and builds the snapshot from Postgres (Decision C), so this body has no field a client could smuggle numbers through.
object
session_metrics- session_metricsmetric- metricsession_moment- session_momentsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewsolution_run- solution_rundashboard_insight- dashboard_insight
object
Body of POST /api/support/threads/.
object
object
session- sessionmetric- metricsession_moment- session_momentsolution_run- solution_rundashboard_insight- dashboard_insightsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewpage- page
object
A typed context REFERENCE — never content. The server verifies team ownership and builds the snapshot from Postgres (Decision C), so this body has no field a client could smuggle numbers through.
object
session_metrics- session_metricsmetric- metricsession_moment- session_momentsessions_recent- sessions_recentteam_overview- team_overviewclient_overview- client_overviewsolution_run- solution_rundashboard_insight- dashboard_insight
object
Responses
Section titled “Responses”Existing thread resumed for this subject_ref (created: false).
POST /api/support/threads/ response — the thread plus the
resume-or-create verdict (created: false = an existing subject
thread was resumed).
object
product- Platform helpperformance- Performance
The identity-bearing params, view-only ones stripped.
A thread’s subject is not always its subject_id: a dashboard is keyed
by its activity and a page thread by its route, and neither has an id.
Without this the client cannot tell two id-less threads apart — every
page thread was {subject_kind: "page", subject_id: null} on the
wire, so the drawer could not re-open the right one when the coach
came back to a tab (#945).
Stripped server-side (threads.identity_params) so the rule for what
counts as identity lives in ONE place: a client comparing raw params
would fork on units and never match.
object
Context chip on a thread — label + kind. The snapshot content stays server-side (it is prompt material, not display material); user file attachments additionally expose a short-lived download URL + media type so the FE can render an image thumb.
object
Example
{ "kind": "product"}New thread created (created: true).
POST /api/support/threads/ response — the thread plus the
resume-or-create verdict (created: false = an existing subject
thread was resumed).
object
product- Platform helpperformance- Performance
The identity-bearing params, view-only ones stripped.
A thread’s subject is not always its subject_id: a dashboard is keyed
by its activity and a page thread by its route, and neither has an id.
Without this the client cannot tell two id-less threads apart — every
page thread was {subject_kind: "page", subject_id: null} on the
wire, so the drawer could not re-open the right one when the coach
came back to a tab (#945).
Stripped server-side (threads.identity_params) so the rule for what
counts as identity lives in ONE place: a client comparing raw params
would fork on units and never match.
object
Context chip on a thread — label + kind. The snapshot content stays server-side (it is prompt material, not display material); user file attachments additionally expose a short-lived download URL + media type so the FE can render an image thumb.
object
Example
{ "kind": "product"}object
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).
Examplegenerated
{ "detail": "example"}object
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).
Examplegenerated
{ "detail": "example"}object
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).
Examplegenerated
{ "detail": "example"}object
429 — rate limit exceeded. Honour the Retry-After response header (seconds to wait) before retrying; it is sent on every 429.
Examplegenerated
{ "detail": "example"}