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

# Search traces

> Search traces for a project



## OpenAPI

````yaml POST /api/traces/search
openapi: 3.1.0
info:
  title: LangWatch API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
  - url: https://app.langwatch.ai
security:
  - api_key: []
paths:
  /api/traces/search:
    post:
      description: Search traces for a project
      operationId: postApiTracesSearch
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                filters:
                  type: object
                  properties:
                    topics.topics:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    topics.subtopics:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.user_id:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.thread_id:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.customer_id:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.labels:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.key:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.value:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    metadata.prompt_ids:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    traces.error:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    spans.type:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    spans.model:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.evaluator_id:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.evaluator_id.guardrails_only:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.passed:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.score:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.state:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    evaluations.label:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    events.event_type:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    events.metrics.key:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    events.metrics.value:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    events.event_details.key:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    annotations.hasAnnotation:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                    sentiment.input_sentiment:
                      anyOf:
                        - type: array
                          items:
                            type: string
                        - type: object
                          additionalProperties:
                            type: array
                            items:
                              type: string
                        - type: object
                          additionalProperties:
                            type: object
                            additionalProperties:
                              type: array
                              items:
                                type: string
                  additionalProperties: false
                  default: {}
                traceIds:
                  type: array
                  items:
                    type: string
                negateFilters:
                  type: boolean
                pageOffset:
                  type: number
                pageSize:
                  type: number
                groupBy:
                  type: string
                sortBy:
                  type: string
                sortDirection:
                  type: string
                updatedAt:
                  type: number
                scrollId:
                  type:
                    - string
                    - 'null'
                startDate:
                  anyOf:
                    - type: number
                    - type: string
                endDate:
                  anyOf:
                    - type: number
                    - type: string
                format:
                  type: string
                  enum:
                    - digest
                    - json
                  description: >-
                    Output format: 'digest' (AI-readable trace digest) or 'json'
                    (full raw data)
                llmMode:
                  type: boolean
              required:
                - startDate
                - endDate
      responses:
        '200':
          description: Matching traces with pagination
          content:
            application/json:
              schema:
                type: object
                properties:
                  traces:
                    type: array
                    items: {}
                  pagination:
                    type: object
                    properties:
                      totalHits:
                        type: number
                      scrollId:
                        type: string
                    required:
                      - totalHits
                required:
                  - traces
                  - pagination
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: X-Auth-Token

````