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

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

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

List recent query traces

## Path parameters

- `context_id` string, required

## Query parameters

- `limit` integer
- `cursor` string
- `count` boolean

## Response `200`

- TraceListResponseJson
  - `page` PageMeta, required — The pagination block returned beside a page's rows.
    - `hasMore` boolean, required — Whether a further page exists.
    - `nextCursor` string, nullable — Token for the next page; absent on the last page.
    - `totalSize` integer, nullable — Total rows matching the filters, present only when the request asked for it with `count=true`.
  - `traces` TraceRecordJson[], required
    - `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
- `422` — Invalid context id
- `503` — Server too busy: the per-pod in-flight request cap was exceeded. Retry per the `Retry-After` header.

## Changes

- **2026-08-24** `9f1598713067` — 4 info
  - added the new optional `query` request parameter `count`
  - added the new optional `query` request parameter `cursor`
  - added the non-success response with the status `503`
  - added the required property `page` to the response with the `200` status
- **2026-06-16** `52b41ab517b6` — 2 info
  - added the optional property `traces/items/parent` to the response with the `200` status
  - added the optional property `traces/items/retrievals` to the response with the `200` status
- **2026-06-08** `741d58b9ef89` — 2 warning
  - removed the optional property `traces/items/parent` from the response with the `200` status
  - removed the optional property `traces/items/retrievals` from the response with the `200` status

[Change history](https://skmtc.dev/surrealdb/apis/spectron/changes/api/v1/:context_id/traces/get.md)

---

[API](https://skmtc.dev/surrealdb/apis/spectron.md) · [All operations](https://skmtc.dev/surrealdb/apis/spectron/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/surrealdb/spectron/revisions/9f1598713067/schema)
