Skip to main content
GET
/
v1
/
sessions
/
{session_id}
/
analysis-input
Fetch the canonical analysis input for a completed session
curl --request GET \
  --url https://api-sandbox.featherhq.com/v1/sessions/{session_id}/analysis-input \
  --header 'x-api-key: <api-key>'
{
  "session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "channel": "<string>",
  "started_at": "2023-11-07T05:31:56Z",
  "ended_at": "2023-11-07T05:31:56Z",
  "completion_reason": "<string>",
  "analyzer_input_schema_version": 2,
  "messages": [
    {
      "turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "role": "<string>",
      "timestamp": "2023-11-07T05:31:56Z",
      "content": "<string>",
      "tool_calls": [
        {
          "id": "<string>",
          "function": {
            "name": "<string>",
            "arguments": "<string>"
          },
          "type": "function"
        }
      ],
      "tool_results": {
        "tool_call_id": "<string>",
        "output": "<string>",
        "error": "<string>"
      },
      "model_used": "<string>",
      "latency_ms": 123,
      "truncated": false,
      "original_char_count": 123
    }
  ],
  "rag_traces": [
    {
      "rag_query_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "assistant_turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "query_hash": "<string>",
      "kb_ids": [
        "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      ],
      "retrieved": [
        {
          "chunk_id": "<string>",
          "doc_id": "<string>",
          "version_id": "<string>",
          "score": 123
        }
      ],
      "top_score": 123,
      "hit": true,
      "latency_ms": 123,
      "answerability": {
        "label": "<string>",
        "reason_code": "<string>",
        "raw_top_score": 123,
        "score_basis": "<string>",
        "mode": "<string>",
        "action": "<string>",
        "threshold_low": 123,
        "threshold_high": 123
      }
    }
  ],
  "citations": [
    {
      "assistant_turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "kb_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "doc_id": "<string>",
      "chunk_id": "<string>",
      "version_id": "<string>"
    }
  ],
  "tool_calls": [
    {
      "tool_call_id": "<string>",
      "assistant_turn_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "arguments": "<string>",
      "arguments_parsed": null,
      "result": "<string>",
      "error": "<string>",
      "latency_ms": 123
    }
  ],
  "handoff_events": [
    {
      "timestamp": "2023-11-07T05:31:56Z",
      "transferred_to_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "reason": "<string>"
    }
  ],
  "kb_snapshot": {
    "captured_at": "2023-11-07T05:31:56Z",
    "kb_versions": {}
  },
  "user_feedback": {
    "timestamp": "2023-11-07T05:31:56Z",
    "rating": 123,
    "comment": "<string>"
  },
  "csat": {
    "timestamp": "2023-11-07T05:31:56Z",
    "score": 123,
    "scale_max": 5
  },
  "reopen": {
    "timestamp": "2023-11-07T05:31:56Z",
    "reason": "<string>"
  },
  "customer_metadata": {},
  "missing_evidence_reasons": []
}

Authorizations

x-api-key
string
header
required

Path Parameters

session_id
string<uuid>
required

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.

session_id
string<uuid>
required
organization_id
string<uuid>
required
agent_id
string<uuid> | null
required
channel
string
required
started_at
string<date-time>
required
ended_at
string<date-time> | null
required
completion_reason
string | null
required
knowledge_gap_analysis_outcome
enum<string> | null
required

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.

Available options:
resolved,
unresolved,
transferred,
expired,
error,
abandoned,
voicemail,
escalated,
call_failed
analyzer_input_schema_version
integer
default:2
messages
MessageEntry · object[]
rag_traces
RagTraceEntry · object[]
citations
CitedChunk · object[]
tool_calls
ToolCallEntry · object[]
handoff_events
HandoffEvent · object[]
kb_snapshot
KbSnapshotEntry · object

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.

user_feedback
FeedbackEntry · object

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
CSATEntry · object

CSAT score against a session. Nullable in v1 (no capture surface).

reopen
ReopenEntry · object

Ticket reopen event. Nullable in v1 (no capture surface).

customer_metadata
Customer Metadata · object
missing_evidence_reasons
enum<string>[]

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.

Available options:
no_rag_trace,
no_kb_snapshot,
no_citations,
no_tool_trace,
no_csat,
no_user_feedback,
transcript_redaction_skipped,
legacy_session