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

# Get trace for a call

> Retrieve the distributed trace data for a specific call from Tempo.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/trace/call/{call_id}
openapi: 3.1.0
info:
  title: Diga API
  version: 0.1.0
servers:
  - url: https://api.diga.io
    description: Production
security: []
paths:
  /v1/trace/call/{call_id}:
    get:
      tags:
        - Traces
      summary: Get trace for a call
      description: Retrieve the distributed trace data for a specific call from Tempo.
      operationId: get_call_trace_v1_trace_call__call_id__get
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The call ID to get the trace for
            title: Call Id
          description: The call ID to get the trace for
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceResponse'
        '404':
          description: Not found - No trace associated with this call
          content:
            application/json:
              example:
                status: error
                error_code: TRACE_NOT_FOUND
                message: Trace not found
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: Service unavailable - Cannot connect to Tempo
          content:
            application/json:
              example:
                status: error
                error_code: TEMPO_UNAVAILABLE
                message: Tempo service unavailable
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
        '504':
          description: Gateway timeout - Tempo request timed out
          content:
            application/json:
              example:
                status: error
                error_code: TEMPO_TIMEOUT_API
                message: Timeout fetching trace
              schema:
                $ref: '#/components/schemas/ErrorResponseSchema'
      security:
        - CustomHTTPBearer: []
components:
  schemas:
    TraceResponse:
      properties:
        id:
          type: string
          title: Trace ID
          description: The unique identifier for this trace.
        call_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Call ID
          description: The DIGA call ID associated with this trace.
        root_service:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Service
          description: The service that initiated the trace.
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Time
          description: When the trace started.
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End Time
          description: When the trace ended.
        duration_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration (ms)
          description: Total duration of the trace in milliseconds.
        span_count:
          type: integer
          title: Span Count
          description: The number of spans in this trace.
        spans:
          items:
            $ref: '#/components/schemas/SpanResponse'
          type: array
          title: Spans
          description: Hierarchical tree of spans with parent-child relationships.
      type: object
      required:
        - id
        - span_count
      title: TraceResponse
      description: Response schema for a complete trace.
    ErrorResponseSchema:
      properties:
        status:
          type: string
          title: Status
          description: Status of the response, always 'error' for error responses
          default: error
        error_code:
          type: string
          title: Error Code
          description: Machine-readable error code in SCREAMING_SNAKE_CASE format
          examples:
            - PROJECT_NOT_FOUND
            - INVALID_EMAIL
            - UNAUTHORIZED_ROLE
        message:
          type: string
          title: Message
          description: Human-readable error message with details
          examples:
            - Project with id 550e8400-e29b-41d4-a716-446655440000 not found
            - The email invalid@email is not valid
            - Insufficient permissions to perform this action
      type: object
      required:
        - error_code
        - message
      title: ErrorResponseSchema
      description: Standard error response format for all API errors.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SpanResponse:
      properties:
        id:
          type: string
          title: Span ID
          description: The unique identifier for this span.
        parent_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Span ID
          description: The span ID of the parent span, if any.
        operation_name:
          type: string
          title: Operation Name
          description: The name of the operation this span represents.
        service_name:
          type: string
          title: Service Name
          description: The name of the service that generated this span.
        start_time:
          type: string
          format: date-time
          title: Start Time
          description: When the span started.
        duration_ms:
          type: number
          title: Duration (ms)
          description: The duration of the span in milliseconds.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: The status of the span (OK, ERROR, etc.).
        tags:
          additionalProperties: true
          type: object
          title: Tags
          description: Key-value pairs of span attributes/tags.
        children:
          anyOf:
            - items:
                $ref: '#/components/schemas/SpanResponse'
              type: array
            - type: 'null'
          title: Children
          description: Child spans nested under this span.
      type: object
      required:
        - id
        - operation_name
        - service_name
        - start_time
        - duration_ms
      title: SpanResponse
      description: Response schema for a single span within a trace.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    CustomHTTPBearer:
      type: http
      scheme: bearer

````