> ## Documentation Index
> Fetch the complete documentation index at: https://docs.traceback.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Distributed Trace

> Retrieve full flamegraph span tree for a given trace ID.



## OpenAPI

````yaml /openapi.json get /traces/{id}
openapi: 3.1.0
info:
  title: Traceback API
  version: 1.0.0
  description: >-
    REST API for ingesting, querying, and managing errors, distributed traces,
    session replays, and source maps in Traceback.
servers:
  - url: https://api.traceback.dev/v1
    description: Production Server
  - url: https://sandbox-api.traceback.dev/v1
    description: Sandbox / Staging Server
security:
  - bearerAuth: []
paths:
  /traces/{id}:
    get:
      summary: Get Distributed Trace
      description: Retrieve full flamegraph span tree for a given trace ID.
      operationId: getTraceById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Trace span tree returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  trace_id:
                    type: string
                  root_service:
                    type: string
                  duration_ms:
                    type: number
                  spans:
                    type: array
                    items:
                      $ref: '#/components/schemas/TraceSpan'
components:
  schemas:
    TraceSpan:
      type: object
      required:
        - trace_id
        - span_id
        - name
        - start_time
        - end_time
      properties:
        trace_id:
          type: string
          example: 4bf92f3577b34da6a3ce929d0e0e4736
        span_id:
          type: string
          example: 00f067aa0ba902b7
        parent_span_id:
          type: string
          nullable: true
          example: 5fb397be34d23b0f
        name:
          type: string
          example: POST /api/checkout
        service_name:
          type: string
          example: checkout-service
        start_time:
          type: integer
          example: 1788472556000000
        end_time:
          type: integer
          example: 1788472556245000
        status:
          type: string
          enum:
            - ok
            - error
            - unset
          example: error
        attributes:
          type: object
          additionalProperties:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        Your project or organization API key starting with `tb_live_` or
        `tb_test_`.

````