---
title: "Fetch Trace"
method: GET
path: "/tracing/traces/{trace_id}"
tags: ["Deprecated"]
deprecated: true
---

# Fetch Trace

`GET /tracing/traces/{trace_id}`

> **Deprecated.**

Fetch a single trace by `trace_id`.

Returns the trace as a `traces` map keyed by `trace_id` → span
name. The response is empty when the trace is not in the current
project. `trace_id` must be a 32-char hex UUID; any other format
returns `400`.

For flat-list retrieval across many traces, use
`POST /tracing/spans/query` with `focus="span"`.

## Path parameters

- `trace_id` string, required

## Response `200`

Successful Response

- OTelTracingResponse — Response from span/trace queries. Exactly one of `spans` or `traces` is populated, controlled by the `focus` field in the request (`"span"` for flat lists, `"trace"` for nested trees). The shapes here match what the ingest endpoint accepts, so you can round-trip data between environments.
  - `count` integer — Total number of matching traces or spans in the window.
  - `spans` SpanOutput[], nullable — Flat list of spans, populated when the query was run with `focus="span"`.
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `trace_id` string, required
    - `span_id` string, required
    - `parent_id` string, nullable
    - `trace_type` 'invocation' | 'annotation' | 'unknown'
    - `span_type` 'agent' | 'chain' | 'workflow' | 'task' | 'tool' | 'embedding' | 'query' | 'llm' | 'completion' | 'chat' | 'rerank' | 'unknown'
    - `span_kind` 'SPAN_KIND_UNSPECIFIED' | 'SPAN_KIND_INTERNAL' | 'SPAN_KIND_SERVER' | 'SPAN_KIND_CLIENT' | 'SPAN_KIND_PRODUCER' | 'SPAN_KIND_CONSUMER'
    - `span_name` string, nullable
    - `start_time` union
      - string, date-time
      - integer
    - `end_time` union
      - string, date-time
      - integer
    - `status_code` 'STATUS_CODE_UNSET' | 'STATUS_CODE_OK' | 'STATUS_CODE_ERROR'
    - `status_message` string, nullable
    - `session_id` string, nullable
    - `user_id` string, nullable
    - `agent_id` string, nullable
    - `attributes` object, nullable
    - `references` OTelReferenceOutput[], nullable
      - `version` string, nullable
      - `slug` string, nullable
      - `id` string, uuid, nullable
      - `attributes` object, nullable
    - `links` OTelLinkOutput[], nullable
      - `span_id` string, nullable
      - `trace_id` string, nullable
      - `attributes` object, nullable
    - `hashes` OTelHashOutput[], nullable
      - `id` string, uuid, nullable
      - `attributes` object, nullable
    - `exception` object, nullable
    - `events` OTelEventOutput[], nullable
      - `name` string, required
      - `timestamp` union, required
        - string, date-time
        - integer
      - `attributes` object, nullable
  - `traces` object, nullable — Nested tree of spans keyed by `trace_id` → span name, populated when the query was run with `focus="trace"` (default).

## Other responses

- `422` — Validation Error

## Changes

> 359 revisions in range; 4 could not be searched.

- **2026-08-03** `fc532d6dc820` — 9 info
  - added the optional property `spans/anyOf[subschema #1]/items/agent_id` to the response with the `200` status
  - added the optional property `spans/anyOf[subschema #1]/items/session_id` to the response with the `200` status
  - added the optional property `spans/anyOf[subschema #1]/items/user_id` to the response with the `200` status
  - added the optional property `traces/anyOf[subschema #1]/additionalProperties/spans/anyOf[subschema #1]/additionalProperties/anyOf[subschema #1: SpansNode]/agent_id` to the response with the `200` status
  - …5 more
- **2026-05-19** `a7f9a6823230` — 2 warning
  - removed the optional property `support_id` from the response with the `200` status
  - removed the optional property `support_ts` from the response with the `200` status
- **2026-05-08** `bb630edffa27` — 3 info
  - api tag `Deprecated` added
  - api tag `Traces` removed
  - endpoint deprecated
- **2026-05-02** `6e37373d45fe` — 2 info
  - api tag `Traces` added
  - api tag `Observability` removed
- **2026-04-23** `925e8b901a26` — 2 info
  - added the optional property `support_id` to the response with the `200` status
  - added the optional property `support_ts` to the response with the `200` status

[Full history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/tracing/traces/:trace_id/get.md)

---

[API](https://skmtc.dev/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.dev/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/revisions/713e4f3b7519/schema)
