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

# List trace spans for a simulation output

> Read back the raw OTLP trace spans recorded for one simulation output — a simulation or a
monitored conversation (both are simulation outputs). Offset-paginated. Complements
`GET /traces/summary`, which returns only a privacy-safe structural summary.




## OpenAPI

````yaml /api-reference/v1/traces-v1.yaml get /traces/spans
openapi: 3.0.3
info:
  title: Traces API
  version: 1.0.0
  description: >
    OTLP/HTTP trace ingestion endpoint for Coval. Accepts native OpenTelemetry

    spans (protobuf or JSON, `ExportTraceServiceRequest` from
    `opentelemetry-proto`)

    and associates them with a simulation output or a monitoring conversation.


    Each request must identify its target via exactly one of:
      - `X-Simulation-Id` — for simulation flows (the simulation output ID).
      - `X-Conversation-Id` — for monitoring flows (the conversation ID returned
        by `POST /v1/conversations:submit`).

    For most use cases, the recommended client is the OpenTelemetry SDK itself

    (`OTLPSpanExporter` from `opentelemetry-exporter-otlp-proto-http` pointed at

    `https://api.coval.dev/v1/traces`). This OpenAPI spec exists for users who

    prefer to generate a typed HTTP client (e.g. with `openapi-python-client`).
  contact:
    name: Coval API Support
    url: https://coval.dev
    email: support@coval.dev
servers:
  - url: https://api.coval.dev/v1
    description: Production API
security:
  - apiKey: []
tags:
  - name: Traces
    description: OTLP trace ingestion for simulations and monitoring conversations.
paths:
  /traces/spans:
    get:
      tags:
        - Traces
      summary: List trace spans for a simulation output
      description: >
        Read back the raw OTLP trace spans recorded for one simulation output —
        a simulation or a

        monitored conversation (both are simulation outputs). Offset-paginated.
        Complements

        `GET /traces/summary`, which returns only a privacy-safe structural
        summary.
      operationId: listSimulationTraces
      parameters:
        - name: simulation_output_id
          in: query
          required: true
          description: The simulation output whose trace spans to list.
          schema:
            type: string
            minLength: 1
        - name: limit
          in: query
          required: false
          description: Max spans to return (1-200, default 50).
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
        - name: offset
          in: query
          required: false
          description: Number of spans to skip for pagination (max 100000).
          schema:
            type: integer
            minimum: 0
            maximum: 100000
            default: 0
      responses:
        '200':
          description: A page of trace spans
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationTracesResponse'
        '400':
          description: Invalid or missing query parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: The API key lacks the traces:read scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          description: The trace store rejected the query (permanent, non-retryable)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Trace store temporarily unavailable (retryable)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
components:
  schemas:
    SimulationTracesResponse:
      type: object
      required:
        - traces
        - total_spans
      properties:
        traces:
          type: array
          description: Trace spans (raw OTLP span rows).
          items:
            type: object
            additionalProperties: true
        total_spans:
          type: integer
          description: Total spans recorded for this simulation output.
    ErrorResponse:
      type: object
      description: Standard error response
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: INVALID_ARGUMENT
            message:
              type: string
              description: Human-readable error message
              example: Invalid request parameters
            details:
              type: array
              description: Detailed error information
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: Field that caused the error
                    example: X-Simulation-Id
                  description:
                    type: string
                    description: Description of the error
                    example: No simulation output found with this ID
  responses:
    Unauthorized:
      description: Authentication failed or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHENTICATED
              message: Authentication failed
              details:
                - field: X-API-Key
                  description: Invalid or missing API key
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL
              message: Internal server error
              details:
                - description: An unexpected error occurred while processing the request
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key for authentication

````