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

# Search Traces

> Returns a cursor-paginated page of filtered trace rows for a project. Pass `nextCursor` from the response as `cursor` to fetch the next page.

Returns a cursor-paginated page of filtered trace rows. Pass `nextCursor` from the response as `cursor` to fetch the next page.

See [Export Logs](/monitor/filter-and-search-logs) for filter types, available columns, and pagination conventions.


## OpenAPI

````yaml POST /logs/traces
openapi: 3.1.1
info:
  title: Adaline API
  version: 2.0.0
  description: >-
    Public API for managing Adaline projects, prompts, datasets, evaluators,
    evaluations, providers, models, and deployments.


    Generated from Zod schemas — this spec is the single source of truth.
servers:
  - url: https://api.adaline.ai/v2
    description: Production API
security: []
tags:
  - name: datasets
    description: Manage prompt datasets and their columns and rows.
  - name: projects
    description: List and manage Adaline projects.
  - name: providers
    description: List configured LLM providers and their settings.
  - name: models
    description: List available models across providers.
  - name: prompts
    description: Create and manage prompts and their drafts.
  - name: evaluators
    description: Configure evaluators attached to a prompt.
  - name: evaluations
    description: Run and inspect evaluation results.
  - name: deployments
    description: Retrieve deployed prompt snapshots.
  - name: logs
    description: Ingest execution traces and spans for observability.
paths:
  /logs/traces:
    post:
      tags:
        - logs
      summary: Search traces
      description: >-
        Returns a cursor-paginated page of filtered trace rows for a project.
        Pass `nextCursor` from the response as `cursor` to fetch the next page.
      operationId: searchLogTraces
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchLogTracesRequest'
      responses:
        '200':
          description: A page of search results with cursor-based pagination metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchTracesResponse'
          headers:
            X-Request-Id:
              description: >-
                Unique identifier for the request. Returned in every response.
                Send a custom value to correlate requests, or omit to receive a
                generated UUID.
              schema:
                type: string
                format: uuid
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden — invalid or unauthorized API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found — project not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    SearchLogTracesRequest:
      title: Search Log Traces Request
      type: object
      description: Request payload for paginated trace search.
      required:
        - projectId
      properties:
        projectId:
          $ref: '#/components/schemas/BaseEntityId'
          description: The project to search traces in.
        startedAfter:
          type: integer
          description: >-
            Unix timestamp in milliseconds. Only return rows started at or after
            this time.
        startedBefore:
          type: integer
          description: >-
            Unix timestamp in milliseconds. Only return rows started at or
            before this time.
        status:
          type: string
          enum:
            - success
            - failure
            - aborted
            - cancelled
            - pending
            - unknown
          description: Filter by status.
        name:
          type: string
          description: Case-insensitive substring match on the trace or span name.
        referenceId:
          type: string
          description: Exact match on the reference ID.
        sessionId:
          type: string
          description: Exact match on the session ID.
        filters:
          type: array
          maxItems: 20
          items:
            $ref: '#/components/schemas/LogFilterObject'
          description: Typed filter objects for advanced queries. ANDed with flat params.
        sort:
          type: string
          enum:
            - startedAt:asc
            - startedAt:desc
          description: Sort order. Defaults to startedAt:desc.
        limit:
          type: integer
          minimum: 1
          maximum: 200
          description: Page size. Defaults to 50, max 200.
        cursor:
          type: string
          description: Opaque pagination cursor from a previous response.
    SearchTracesResponse:
      type: object
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        traces:
          type: array
          items:
            $ref: '#/components/schemas/LogTraceItem'
          description: Array of log trace items.
      required:
        - pagination
        - traces
      title: Search Traces Response
      description: Paginated search results for log traces.
    ErrorResponse:
      title: Error Response
      type: object
      description: >-
        Standard error response envelope. Permits backend-specific sibling
        fields (e.g. Zod issue details) alongside the typed `error`.
      properties:
        error:
          description: >-
            Error details — typed envelope, or a raw string reason when the
            backend's validator produces a short summary (e.g. Zod validation
            fallback).
          oneOf:
            - type: string
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable error code.
                  enum:
                    - VALIDATION_ERROR
                    - INVALID_CURSOR
                    - AUTHENTICATION_REQUIRED
                    - FORBIDDEN
                    - RESOURCE_NOT_FOUND
                    - CONFLICT
                    - PAYLOAD_TOO_LARGE
                    - RATE_LIMITED
                    - INTERNAL_ERROR
                message:
                  type: string
                  description: Human-readable error message.
                details:
                  type: array
                  description: Optional field-level validation details.
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      issue:
                        type: string
                    required:
                      - field
                      - issue
              required:
                - code
                - message
              additionalProperties: true
      required:
        - error
      additionalProperties: true
    BaseEntityId:
      title: Base Entity ID
      type: string
      description: Unique identifier for an entity, between 20 and 80 characters.
      minLength: 20
      maxLength: 80
    LogFilterObject:
      title: Log Filter Object
      type: object
      description: >-
        Typed filter object. Discriminated union on `type`: string, number,
        datetime, or arrayContains.
      required:
        - type
        - column
        - operator
        - value
      properties:
        type:
          type: string
          enum:
            - string
            - number
            - datetime
            - arrayContains
          description: Filter type. Determines valid operators and value types.
        column:
          type: string
          description: Column to filter on. Unknown columns are silently ignored.
        operator:
          type: string
          description: >-
            Comparison operator. Valid values depend on type: string (eq,
            contains), number (eq, gt, gte, lt, lte), datetime (gt, gte, lt,
            lte), arrayContains (contains).
        value:
          description: >-
            Filter value. String for string/arrayContains types, number for
            number/datetime types.
    Pagination:
      title: Pagination
      type: object
      description: Pagination metadata for list endpoints with cursor-based navigation.
      properties:
        limit:
          type: integer
          exclusiveMinimum: 0
        returned:
          type: integer
          minimum: 0
        hasMore:
          type: boolean
        nextCursor:
          type:
            - string
            - 'null'
      required:
        - limit
        - returned
        - hasMore
        - nextCursor
    LogTraceItem:
      title: Log Trace Item
      type: object
      description: A log trace summary returned in list and search responses.
      properties:
        id:
          type: string
          description: Unique trace identifier.
        name:
          type: string
          description: Name of the trace.
        status:
          type: string
          description: Trace status.
          enum:
            - success
            - failure
            - aborted
            - cancelled
            - pending
            - unknown
        startedAt:
          $ref: '#/components/schemas/UnixTimestamp'
          description: When the trace started.
        endedAt:
          $ref: '#/components/schemas/UnixTimestamp'
          description: When the trace ended.
        latency:
          type: number
          description: Trace duration in milliseconds.
        referenceId:
          type:
            - string
            - 'null'
          description: External reference ID.
        sessionId:
          type:
            - string
            - 'null'
          description: Session ID for grouping related traces.
        attributes:
          type: object
          additionalProperties:
            type: string
          description: Key-value attributes attached to the trace.
        tags:
          type: array
          items:
            type: string
          description: Tags attached to the trace.
        totalCost:
          type:
            - number
            - 'null'
          description: Total cost across all spans.
        totalInputTokens:
          type:
            - number
            - 'null'
          description: Total input tokens across all spans.
        totalOutputTokens:
          type:
            - number
            - 'null'
          description: Total output tokens across all spans.
        spanIds:
          type: array
          items:
            type: string
          description: IDs of spans belonging to this trace.
        createdAt:
          $ref: '#/components/schemas/UnixTimestamp'
          description: When the trace was created.
        updatedAt:
          $ref: '#/components/schemas/UnixTimestamp'
          description: When the trace was last updated.
      required:
        - id
        - name
        - status
        - startedAt
        - endedAt
        - latency
        - referenceId
        - sessionId
        - attributes
        - tags
        - totalCost
        - totalInputTokens
        - totalOutputTokens
        - spanIds
        - createdAt
        - updatedAt
    UnixTimestamp:
      title: Unix Timestamp
      type: integer
      format: int64
      description: Unix timestamp in milliseconds.
      minimum: 1672511400000
      maximum: 33229420200000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Workspace API key. Pass as `Authorization: Bearer <key>`.'

````