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

# Fetch Trace

`GET /preview/tracing/traces/{trace_id}`

## Path parameters

- `trace_id` string, required

## Response `200`

Successful Response

- OTelTracingResponse
  - `count` integer
  - `spans` OTelFlatSpanOutput[], nullable
    - `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
    - `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, required
      - `trace_id` string, required
      - `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

## Other responses

- `422` — Validation Error

## Changes

- **2026-01-14** `53da4c9de2b7` — 8 info
  - api tag `Deprecated` added
  - api tag `Tracing` removed
  - added `#/components/schemas/OTelStatusCode` to the `spans/anyOf[subschema #1]/items/status_code` response property `anyOf` list for the response status `200`
  - added `#/components/schemas/OTelStatusCode` to the `traces/anyOf[subschema #1]/additionalProperties/spans/anyOf[subschema #1]/additionalProperties/anyOf[subschema #1: OTelSpan]/status_code` response property `anyOf` list for the response status `200`
  - …4 more
- **2025-11-05** `e62506c24377` — 3 breaking, 2 warning, 17 info
  - `path` request parameter `trace_id` list-of-types was narrowed by removing types `integer`
  - the response property `count` became optional for the status `200`
  - removed the required property `version` from the response with the `200` status
  - removed the optional property `newest` from the response with the `200` status
  - …18 more
- **2025-06-27** `e3e84db47198` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agenta-ai/apis/agenta-api/changes/preview/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.dev/agenta-ai/apis/agenta-api/revisions/53da4c9de2b7?raw)
