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

# List Trace Filter Values

> Distinct values for an open-ended categorical filter field.

The values-discovery companion to the typed ``filters`` parameter on the
trace list: the filterable field catalog lives in the generated schema,
while a field's current values are dynamic per project. Only fields the
registry marks as distinct-query (model_name, environment) are listable;
the field is resolved through the registry before it reaches SQL, so it can
never be a raw client-supplied column name.

Args:
    auth (DualStampedAuth): Resolved credential context (API key or user
        session token); scopes the read to its project and stamps the
        rate-limit identity.
    field (str): The categorical field to enumerate.
    start_after (datetime | None): Lower bound on span start time (active
        window).
    end_before (datetime | None): Upper bound on span start time (active
        window), symmetric with ``start_after`` so options match the list's
        window.

Returns:
    FilterValuesResponse: Distinct values ordered by descending frequency.

Raises:
    HTTPException: 400 if the field is unknown or not a distinct-query
        categorical, 500 on a reader failure.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/public/traces/filter-values/{field}
openapi: 3.1.0
info:
  title: TraceRoot Public API
  version: 0.1.0
servers:
  - description: TraceRoot Cloud
    url: https://app.traceroot.ai
  - description: Self-hosted
    url: '{baseUrl}'
    variables:
      baseUrl:
        default: http://localhost:8000
        description: Your TraceRoot backend URL
security: []
paths:
  /api/v1/public/traces/filter-values/{field}:
    get:
      tags:
        - Traces
      summary: List Trace Filter Values
      description: >-
        Distinct values for an open-ended categorical filter field.


        The values-discovery companion to the typed ``filters`` parameter on the

        trace list: the filterable field catalog lives in the generated schema,

        while a field's current values are dynamic per project. Only fields the

        registry marks as distinct-query (model_name, environment) are listable;

        the field is resolved through the registry before it reaches SQL, so it
        can

        never be a raw client-supplied column name.


        Args:
            auth (DualStampedAuth): Resolved credential context (API key or user
                session token); scopes the read to its project and stamps the
                rate-limit identity.
            field (str): The categorical field to enumerate.
            start_after (datetime | None): Lower bound on span start time (active
                window).
            end_before (datetime | None): Upper bound on span start time (active
                window), symmetric with ``start_after`` so options match the list's
                window.

        Returns:
            FilterValuesResponse: Distinct values ordered by descending frequency.

        Raises:
            HTTPException: 400 if the field is unknown or not a distinct-query
                categorical, 500 on a reader failure.
      operationId: list_trace_filter_values
      parameters:
        - in: path
          name: field
          required: true
          schema:
            title: Field
            type: string
        - description: Only consider spans starting at or after this timestamp
          in: query
          name: start_after
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: Only consider spans starting at or after this timestamp
            title: Start After
        - description: Only consider spans starting before this timestamp
          in: query
          name: end_before
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            description: Only consider spans starting before this timestamp
            title: End Before
        - description: >-
            Target project for the request. Required when authenticating with a
            user session token (a user credential is only meaningful scoped to a
            project); for an API key it is optional and, if given, must match
            the key's project.
          in: query
          name: project_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Target project for the request. Required when authenticating with
              a user session token (a user credential is only meaningful scoped
              to a project); for an API key it is optional and, if given, must
              match the key's project.
            title: Project Id
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilterValuesResponse'
          description: Successful Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Field is not filterable by distinct values
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Failed to list filter values
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication service unavailable
      security:
        - BearerAuth: []
components:
  schemas:
    FilterValuesResponse:
      description: Distinct values for one categorical filter field, by frequency.
      properties:
        field:
          title: Field
          type: string
        values:
          items:
            $ref: '#/components/schemas/FilterValueCount'
          title: Values
          type: array
      required:
        - field
        - values
      title: FilterValuesResponse
      type: object
    ErrorResponse:
      description: >-
        The canonical public error envelope (matches the gateway's normalized
        shape).
      properties:
        detail:
          title: Detail
          type: string
      required:
        - detail
      title: ErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    FilterValueCount:
      description: A distinct categorical value and how often it occurs.
      properties:
        count:
          title: Count
          type: integer
        value:
          title: Value
          type: string
      required:
        - value
        - count
      title: FilterValueCount
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````

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