---
title: "GET /api/v1/{context_id}/traces/{trace_id}"
method: GET
path: "/api/v1/{context_id}/traces/{trace_id}"
---

# GET /api/v1/{context_id}/traces/{trace_id}

`GET /api/v1/{context_id}/traces/{trace_id}`

Get a single query trace by ID, with its one-hop neighborhood: the owning response trace and the retrieval traces that fed it, including their returned targets. Accepts both decision-trace ids and chat response-trace ids.

## Path parameters

- `context_id` string, required
- `trace_id` string, required

## Response `200`

- TraceRecordJson
  - `cached` boolean, required
  - `createdAt` string, required
  - `id` string, required
  - `latencyMs` integer, required
  - `parent` ResponseTraceSummaryJson — Summary of the response trace that owns a decision trace.
    - `cached` boolean, required
    - `createdAt` string, required
    - `id` string, required
    - `latencyMs` integer, required
    - `responseText` string, required
    - `reusedFrom` string, nullable
    - `sessionId` string, nullable
    - `source` string, required
    - `userMessage` string, required
  - `queryText` string, required
  - `resolutionTier` string, required
  - `retrievals` RetrievalTraceSummaryJson[], nullable — The retrieval traces that fed this decision, with their returned targets. Populated on single-trace reads only; absent from `/traces` lists.
    - `createdAt` string, required
    - `id` string, required
    - `latencyMs` integer, required
    - `mode` string, required
    - `retrievedIds` string[], required
    - `returned` ReturnedRefJson[], required — The targets this retrieval returned, ranked. Empty for legacy traces that persisted only the `retrievedIds` array.
      - `id` string, required — The target row id (`table:key` form).
      - `label` string, nullable — A short human label for the target.
      - `rank` integer, nullable
      - `ref` string, nullable — An inspect ref for the target (`attribute:<type>/<name>/<key>`, `entity:<type>/<name>`, `passage:<document_id>/<index>`), when the target kind has one.
      - `score` number, double, nullable
      - `table` string, required — The target's table (`attribute` / `entity` / `chunk` / `memory_chunk`).
    - `scores` number[], required
    - `tierEntered` integer, required
    - `tierReason` string, required
  - `tierReason` string, required

## Other responses

- `401` — Unauthorized
- `404` — Trace not found
- `422` — Invalid context id

---

[API](https://skmtc.net/surrealdb/apis/spectron.md) · [All operations](https://skmtc.net/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/surrealdb/spectron/versions/52b41ab517b6/schema)
