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

# Search spans



## OpenAPI

````yaml /api/openapi.json get /api/traces/explore/spans
openapi: 3.1.0
info:
  description: HTTP API for the Rootprint log management platform.
  title: Rootprint API
  version: 0.4.5
servers:
  - description: Rootprint API
    url: https://example.com
security:
  - cookieAuth: []
paths:
  /api/traces/explore/spans:
    get:
      tags:
        - Traces
      summary: Search spans
      operationId: getApiTracesExploreSpans
      parameters:
        - description: Unix timestamp in seconds
          in: query
          name: startTs
          required: true
          schema:
            minimum: 0
            pattern: ^\d+$
            type: integer
        - description: Unix timestamp in seconds
          in: query
          name: endTs
          required: true
          schema:
            minimum: 0
            pattern: ^\d+$
            type: integer
        - in: query
          name: service
          schema:
            maxLength: 200
            minLength: 1
            type: string
        - in: query
          name: operation
          schema:
            maxLength: 500
            minLength: 1
            type: string
        - in: query
          name: minMs
          schema:
            minimum: 0
            pattern: ^\d+$
            type: integer
        - in: query
          name: maxMs
          schema:
            minimum: 1
            pattern: ^\d+$
            type: integer
        - in: query
          name: status
          schema:
            default: all
            enum:
              - all
              - error
              - ok
            type: string
        - in: query
          name: root
          schema:
            type: string
        - in: query
          name: q
          schema:
            maxLength: 2000
            type: string
        - in: query
          name: sort
          schema:
            default: '-start'
            enum:
              - '-start'
              - start
              - '-duration'
              - duration
            type: string
        - in: query
          name: limit
          schema:
            default: 50
            maximum: 100
            minimum: 1
            pattern: ^\d+$
            type: integer
        - in: query
          name: offset
          schema:
            default: 0
            maximum: 10000
            minimum: 0
            pattern: ^\d+$
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExploreSpansResponse'
          description: Successful response
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - personalBearer: []
        - cookieAuth: []
components:
  schemas:
    ExploreSpansResponse:
      properties:
        rows:
          items:
            $ref: '#/components/schemas/ExploreSpanRow'
          type: array
        total:
          type: number
      required:
        - rows
        - total
      type: object
    ExploreSpanRow:
      properties:
        durationMicros:
          type: number
        httpStatus:
          anyOf:
            - type: number
            - type: 'null'
        isError:
          type: boolean
        operation:
          type: string
        service:
          type: string
        spanId:
          type: string
        startMs:
          type: number
        traceId:
          type: string
      required:
        - traceId
        - spanId
        - service
        - operation
        - startMs
        - durationMicros
        - isError
        - httpStatus
      type: object
    ApiErrorBody:
      properties:
        error:
          properties:
            code:
              type: string
            details:
              items:
                properties:
                  message:
                    type: string
                  path:
                    type: string
                required:
                  - path
                  - message
                type: object
              type: array
            message:
              type: string
            requestId:
              type: string
            statusCode:
              type: number
          required:
            - code
            - message
            - statusCode
            - requestId
          type: object
      required:
        - error
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Request validation failed
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Authentication required
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Permission denied
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Resource not found
    TooManyRequests:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Rate limit exceeded
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Internal server error
    ServiceUnavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBody'
      description: Upstream service unavailable
  securitySchemes:
    cookieAuth:
      in: cookie
      name: better-auth.session_token
      type: apiKey
    personalBearer:
      description: Query API key (personal or service account)
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.