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

# Read a trace

> Read one trace projected to the requested fields.



## OpenAPI

````yaml https://api.uselemma.ai/openapi.json get /traces/{trace_id}
openapi: 3.1.0
info:
  title: Lemma Platform API
  description: Lemma Platform HTTP API for AI observability and workspace operations.
  version: 0.1.0
servers:
  - url: https://api.uselemma.ai
    description: Lemma production API
security:
  - bearerAuth: []
paths:
  /traces/{trace_id}:
    get:
      tags:
        - Traces
      summary: Read a trace
      description: Read one trace projected to the requested fields.
      operationId: get_trace
      parameters:
        - name: trace_id
          in: path
          required: true
          description: Trace ID.
          schema:
            type: string
        - name: fields
          in: query
          required: true
          description: Comma-separated field names to return (at least one).
          schema:
            type: string
      responses:
        '200':
          description: Trace detail
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  otel_trace_id:
                    type: string
                  service_name:
                    type:
                      - string
                      - 'null'
                  agent_name:
                    type:
                      - string
                      - 'null'
                  thread_id:
                    type:
                      - string
                      - 'null'
                  timestamp:
                    type: string
                    format: date-time
                  release:
                    type:
                      - string
                      - 'null'
                  agent_input: {}
                  agent_input_display:
                    type:
                      - string
                      - 'null'
                  agent_output: {}
                  tool_calls:
                    type: array
                    items:
                      type: object
                      properties:
                        span_id:
                          type: string
                        name:
                          type: string
                        duration_ms:
                          type:
                            - number
                            - 'null'
                        is_error:
                          type: boolean
                        user_facing_message:
                          type:
                            - string
                            - 'null'
                        user_facing_message_truncated:
                          type: boolean
                        user_facing_messages_omitted:
                          type: integer
                          minimum: 0
                        kind:
                          type:
                            - string
                            - 'null'
                        status_code:
                          type:
                            - string
                            - 'null'
                        attributes:
                          type: object
                          additionalProperties: {}
                        attributes_omitted:
                          type: boolean
                          const: true
                      required:
                        - span_id
                        - name
                        - duration_ms
                        - is_error
                        - user_facing_message
                        - user_facing_message_truncated
                        - user_facing_messages_omitted
                      additionalProperties: false
                  issue_extraction:
                    type:
                      - object
                      - 'null'
                    properties:
                      status:
                        type: string
                        enum:
                          - running
                          - completed
                          - skipped
                          - failed
                      reason:
                        type:
                          - string
                          - 'null'
                        enum:
                          - issues_found
                          - no_issues_found
                          - no_spans
                          - unsupported_trace
                          - error
                          - null
                      issue_count:
                        type:
                          - integer
                          - 'null'
                        minimum: 0
                      occurrence_count:
                        type:
                          - integer
                          - 'null'
                        minimum: 0
                      completed_at:
                        type:
                          - string
                          - 'null'
                        format: date-time
                    required:
                      - status
                      - reason
                      - issue_count
                      - occurrence_count
                      - completed_at
                    additionalProperties: false
                required:
                  - id
                additionalProperties: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                  code:
                    type: string
                required:
                  - detail
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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