> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
title: "Get a trace"
description: "Fetch every span recorded for a single trace."
method: "GET"
endpoint: "/api/v1/traces/:traceId"
order: 5
last_verified: 2026-07-27
---

<ApiEndpoint
  method="GET"
  endpoint="/api/v1/traces/:traceId"
  description="Fetch every span recorded for a single trace."
>
  <section>
    ### Path parameters

    <ApiAttribute name="traceId" type="string" description="The trace ID, as recorded on the run summary or a log line's trace_id field." required={true} />
  </section>

  <section>
    ### Response

    ```json {{ title: 'Response' }}
    {
      "trace_id": "4f6a2e1b8c9d7f3a5e2b1c4d6a8f9e0b",
      "spans": [
        {
          "trace_id": "4f6a2e1b8c9d7f3a5e2b1c4d6a8f9e0b",
          "span_id": "a1b2c3d4e5f60718",
          "parent_span_id": "",
          "service": "invoice-processor-worker",
          "name": "process_invoice.extract_fields",
          "kind": 0,
          "start_ns": 1753612801123000000,
          "end_ns": 1753612801823000000,
          "status_code": 0,
          "status_msg": ""
        }
      ]
    }
    ```

    A trace ID with no matching spans still returns `200` with an empty `spans` array — it is not treated as a `404`.
  </section>
</ApiEndpoint>
