Fetch the canonical analysis input for a completed session
Returns the SessionAnalysisInput shape defined in
src/knowledge_gap/analysis_schemas.py.
404— session not found, or owned by a different organization.409— session is not in a terminal state (still active / paused / waiting for human / etc.). The analyzer should only be run on completed sessions.
Authorizations
Path Parameters
Response
Successful Response
Canonical analyzer input built from one completed session.
Required fields are populated for every analysed completed session.
Conditionally-required fields populate when the corresponding capture
succeeded (e.g., rag_traces when retrieval ran). Nullable enrichment
fields are best-effort.
Consumers should consult missing_evidence_reasons before attempting
evidence-backed classifications.
Canonical, analyzer-friendly outcome of a completed session.
Derived from (SessionStatus, SessionTerminationReason) at close time
and persisted on ConvSessionMeta.knowledge_gap_analysis_outcome.
Free-form termination_reason is preserved alongside for forensic
detail.
resolved, unresolved, transferred, expired, error, abandoned, voicemail, escalated, call_failed KB state captured at the moment of the session's first retrieval.
Maps each KB used in the session to the active document-version count
(as a coarse fingerprint of "what was the KB at the time"). The
fine-grained per-doc version of a retrieved chunk is on
RetrievedChunk.version_id.
Free-form user feedback against a session.
Nullable in v1 — no capture surface yet. Shape is reserved so downstream consumers can plan against it.
CSAT score against a session. Nullable in v1 (no capture surface).
Ticket reopen event. Nullable in v1 (no capture surface).
Why a downstream classification may need to lower confidence or skip.
Recorded on SessionAnalysisInput.missing_evidence_reasons by the
assembler when expected traces are unavailable. Analyzer code consults
this list to decide whether to attempt evidence-backed classifications.
no_rag_trace, no_kb_snapshot, no_citations, no_tool_trace, no_csat, no_user_feedback, transcript_redaction_skipped, legacy_session