Skip to content

Ask the in-app support assistant (SSE)

POST
/api/support/ask/
curl --request POST \
--url http://localhost:8000/api/support/ask/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "messages": [ { "role": "user", "content": "example" } ] }'

Server-sent events stream answering a coach’s product / how-to question, grounded in AiKYNETIX’s in-app help content. Send the conversation so far in messages (the latest user turn is the question; earlier turns give context for follow-ups).

Frame sequence: event: meta ({mode, model, lang}) → event: token ({text} chunks, concatenate for the answer) → event: citations ({sources: [...]} — friendly help-section titles) → event: done ({ok, escalate, support_email}).

When the help content doesn’t cover the question, escalate is true and the answer suggests emailing support@aikynetix.com instead of guessing. An invalid body yields a single event: error frame with HTTP 400.

Rate-limited per user (this is the one endpoint backed by a paid model); exceeding the limit returns 429 with a Retry-After header. The conversation accepts at most 30 messages, each up to 4000 characters.

Answers are grounded in user-facing help only — no internal docs, field names, or team/user data are ever included.

Body of POST /api/support/ask/ — the conversation so far. The latest user message is the question; earlier turns give the assistant context for follow-ups. Bounded so a caller can’t push an unbounded prompt at the LLM.

object
messages
required
Array<object>

One turn in the support conversation.

object
role
required
  • user - user
  • assistant - assistant
string
Allowed values: user assistant
content
required
string
>= 1 characters <= 4000 characters

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

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"
}