Skip to content

Resolve the persisted AI coaching artifact for a surface + subject

GET
/api/coaching/artifacts/
curl --request GET \
--url http://localhost:8000/api/coaching/artifacts/ \
--header 'Authorization: Bearer <token>'

Returns the unified, coach-editable AI artifact for one (surface, subject_id, lang, units, focus) key, team-scoped.

markdown is the effective text — the coach’s edit if one exists, else the raw model draft. draft_markdown + is_edited let the UI offer a ‘revert to AI draft’ action and warn before a regenerate. 404 when no artifact has been generated for the key yet (the surface should then stream + generate one).

focus
string

Session focus / dashboard-activity discriminator; default empty.

lang
string

en (default) | ru | es.

subject_id
string

Owning object id (session / run / client / team UUID).

surface
string

session | solution | client | dashboard_overview | dashboard_activity | dashboard_business.

units
string

metric (default) | imperial.

Media typeapplication/json

Read shape. markdown is the effective text (the coach edit if one exists, else the raw model draft) — the field UIs render. draft_markdown

  • is_edited are also exposed so the UI can offer a “revert to AI draft” affordance and warn before a regenerate would overwrite the draft. citations is the grounding provenance (#759) — the curated-corpus section titles the draft was grounded in; the FE replays them as the “Based on: …” footnote when a persisted take is reopened without a live stream (authed session panel + cached Solutions report), so provenance survives non-live paths, not just the SSE citations frame.
object
id
required
string format: uuid
surface
required
string
Allowed values: session solution client dashboard_overview dashboard_activity dashboard_business support
subject_id
required
string format: uuid
lang
required
string
default: en
unit_system
required
string
default: metric
focus
required
string
""
mode
required
string
markdown
required
string
draft_markdown
required
string
edited_markdown
required
string
nullable
is_edited
required
boolean
citations
required
Array<string>
edited_at
required
string format: date-time
nullable
generated_at
required
string format: date-time
updated_at
required
string format: date-time
Example
{
"surface": "session",
"lang": "en",
"unit_system": "metric",
"focus": ""
}
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

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