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

# Get Call Spans

> Retrieve a call's OpenTelemetry spans, flat and in start-time order.

Returns an empty list when the call has no trace, which is the common case — whether
spans exist depends on how the customer's agent is instrumented.



## OpenAPI

````yaml https://api.usetuner.ai/public/openapi.json get /api/v1/workspaces/{workspace_id}/agents/{agent_id}/calls/{call_id}/spans
openapi: 3.1.0
info:
  title: My Public API
  version: 1.0.0
servers:
  - url: https://api.usetuner.ai
security: []
tags:
  - name: calls
    x-group: Calls
  - name: workspaces
    x-group: Workspaces
  - name: agent-settings
    x-group: Agent Settings
  - name: agents
    x-group: Agents
  - name: simulation
    x-group: Simulation
  - name: traces
    x-group: Traces
  - name: providers
    x-group: Providers
paths:
  /api/v1/workspaces/{workspace_id}/agents/{agent_id}/calls/{call_id}/spans:
    get:
      tags:
        - calls
        - calls
      summary: Get Call Spans
      description: >-
        Retrieve a call's OpenTelemetry spans, flat and in start-time order.


        Returns an empty list when the call has no trace, which is the common
        case — whether

        spans exist depends on how the customer's agent is instrumented.
      operationId: >-
        get_call_spans_api_v1_workspaces__workspace_id__agents__agent_id__calls__call_id__spans_get
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the call.
            title: Call Id
          description: Tuner's internal numeric ID for the call.
        - name: agent_id
          in: path
          required: true
          schema:
            type: integer
            description: Tuner's internal numeric ID for the agent.
            title: Agent Id
          description: Tuner's internal numeric ID for the agent.
        - name: workspace_id
          in: path
          required: true
          schema:
            type: integer
            description: Workspace ID. Find this in Workspace > General Settings.
            title: Workspace Id
          description: Workspace ID. Find this in Workspace > General Settings.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CallSpanResponse'
                title: >-
                  Response Get Call Spans Api V1 Workspaces  Workspace Id 
                  Agents  Agent Id  Calls  Call Id  Spans Get
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              example:
                detail: Not authenticated
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: You do not have access to this workspace.
          content:
            application/json:
              example:
                detail: User does not have access to workspace 42
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Agent or call not found.
          content:
            application/json:
              example:
                detail: Call with ID 88 not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
components:
  schemas:
    CallSpanResponse:
      properties:
        span_id:
          type: string
          title: Span Id
          description: This span's id, hex
        parent_span_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Span Id
          description: Owning span's id, hex. Null on the root span.
        trace_id:
          type: string
          title: Trace Id
          description: Id of the trace this span belongs to, hex
        name:
          type: string
          title: Name
          description: Operation name, e.g. 'llm' or 'agent_turn'
        kind:
          anyOf:
            - type: integer
            - type: 'null'
          title: Kind
          description: OpenTelemetry span kind
        start_time:
          type: string
          format: date-time
          title: Start Time
          description: When the operation started
        end_time:
          type: string
          format: date-time
          title: End Time
          description: When the operation finished
        duration_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration Ms
          description: Duration in milliseconds
        status_code:
          type: integer
          title: Status Code
          description: 'OpenTelemetry status: 0 unset, 1 ok, 2 error'
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
          description: Status detail, when the span failed
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
          description: Library that emitted the span
        service_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Name
          description: Emitting service, e.g. 'livekit-agents'
        attributes:
          additionalProperties: true
          type: object
          title: Attributes
          description: Allowlisted span attributes
        resource_attributes:
          additionalProperties: true
          type: object
          title: Resource Attributes
          description: Allowlisted attributes describing the emitting process
      type: object
      required:
        - span_id
        - trace_id
        - name
        - start_time
        - end_time
        - status_code
      title: CallSpanResponse
      description: >-
        One span in a call's trace.


        Returned flat rather than nested. The client rebuilds the tree from

        `parent_span_id`, and needs the flat list regardless to position
        waterfall bars

        against the overall trace window.


        `attributes` holds allowlisted keys only — no transcripts, prompts, LLM
        inputs or

        outputs, or tool arguments. See app/core/otel_span_allowlist.py.
    ErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable description of what went wrong.
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Error body returned when a request fails.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      description: >-
        Use Tuner API key (tr_api_...) or user session token. Find your API key
        in Workspace Settings > API Keys.
      scheme: bearer

````