---
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

---

[API](https://skmtc.net/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.net/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/versions/d43a05d98a9b/schema)
