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

# List filter fields

> Return the catalog of filterable fields available across your query
endpoints — field id, label, value type, supported operators, and the
endpoint contexts each field applies to. Use this to discover canonical
filter ids before constructing a `filters` body on any query endpoint.

**Required scope:** `analytics:read`.




## OpenAPI

````yaml /api-reference/openapi.yaml get /db-mgmt/api/filters
openapi: 3.1.0
info:
  title: Upstack Data API
  version: '1.0'
  description: >
    Programmatic access to your Upstack Data pixel — analytics queries, the

    measures/dimensions catalog, and dashboard view management.


    All requests authenticate with two headers:


    - `x-api-key`: your Upstack API key (mint one at **Settings → API Keys** in
    the dashboard).

    - `x-pixel-id`: the pixel id the request targets. One key is scoped to one
    pixel.
servers:
  - url: https://api.upstackdata.com
    description: Production
security:
  - apiKey: []
    pixelId: []
tags:
  - name: Analytics
    description: Query events, attribution, and cohort analyses.
  - name: Catalog
    description: List the measures available to your pixel.
  - name: Dashboards
    description: >-
      Manage dashboard views — create, update, copy, delete, and the high-level
      preset builder.
  - name: Account
    description: >-
      Read and update the account that owns this API key — display name, active
      owners and admins, and subscription summary.
  - name: Costs
    description: >-
      Read and update every cost surface — global product overrides, shipping
      method, per-variant handling fees and COGS history, and per-type cost
      lines (order / gateway / shipping profile / variable / fixed). Mutations
      trigger the same per-order COGS recalculation as web-UI changes.
  - name: Products
    description: Browse products + variants in the configured catalog.
  - name: Events
    description: Send server-side tracking events directly from your backend.
paths:
  /db-mgmt/api/filters:
    get:
      tags:
        - Catalog
      summary: List filter fields
      description: |
        Return the catalog of filterable fields available across your query
        endpoints — field id, label, value type, supported operators, and the
        endpoint contexts each field applies to. Use this to discover canonical
        filter ids before constructing a `filters` body on any query endpoint.

        **Required scope:** `analytics:read`.
      operationId: listFilters
      responses:
        '200':
          description: Filter-fields catalog.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilterFieldsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - apiKey: []
          pixelId: []
components:
  schemas:
    FilterFieldsResponse:
      type: object
      required:
        - fields
      description: Response shape for `GET /api/filters`.
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/FilterFieldDefinition'
    FilterFieldDefinition:
      type: object
      required:
        - field
        - label
        - valueType
        - supportedOperators
        - applicableContexts
      description: >-
        Public projection of a single filterable field from the backend
        registry.
      properties:
        field:
          $ref: '#/components/schemas/FilterFieldId'
        label:
          type: string
          example: Order source
        description:
          type: string
        valueType:
          $ref: '#/components/schemas/FilterValueType'
        supportedOperators:
          type: array
          items:
            $ref: '#/components/schemas/FilterOperator'
        applicableContexts:
          type: array
          description: Endpoint contexts in which this field is valid.
          items:
            $ref: '#/components/schemas/FilterContext'
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          description: Per-field validation errors (present on 400 responses).
          items:
            type: object
            properties:
              message:
                type: string
              key:
                type: string
              path:
                type: array
                items:
                  type: string
    FilterFieldId:
      type: string
      description: |
        Canonical filter field id (`<scope>.<snake_case_id>`). Each id is only
        valid in certain endpoint contexts — discover the full set via
        `GET /api/filters`.
      enum:
        - orders.source_name
        - orders.customer_type
        - orders.order_type
        - orders.value
        - orders.payment_gateway
        - orders.tags
        - channel.resource_name
        - channel.resource_source
        - channel.resource_status
        - channel.resource_configured_status
        - channel.resource_effective_status
        - channel.account_id
        - channel.campaign_id
        - channel.adset_id
        - channel.ad_id
        - attribution.utm_source
        - attribution.utm_medium
        - attribution.utm_campaign
        - attribution.utm_adset
        - attribution.utm_term
        - attribution.utm_ad
        - attribution.utm_content
        - emq.dataset_id
        - emq.event_name
        - emq.diagnostic_name
    FilterValueType:
      type: string
      description: >-
        Scalar type of a field's column. The operator decides scalar-vs-array on
        the wire.
      enum:
        - string
        - number
        - boolean
    FilterOperator:
      type: string
      description: |
        Operator on a filter condition. Which operators are valid for a field
        depends on its `valueType` — discover with `GET /api/filters`.
      enum:
        - equals
        - not_equals
        - greater_than
        - less_than
        - greater_than_or_equals
        - less_than_or_equals
        - contains
        - in
        - not_in
        - array_includes
        - array_includes_all
        - array_includes_any
    FilterContext:
      type: string
      description: Endpoint context a filter is evaluated in.
      enum:
        - query_measures
        - cohort_analysis
        - products_report
        - attribution
        - channel_details
        - emq_analytics
  responses:
    Unauthorized:
      description: >-
        Missing or invalid `x-api-key` / `x-pixel-id`, or key is
        revoked/expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        API key does not carry the required scope for this endpoint, or body
        `pixelId` does not match the `x-pixel-id` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Upstack API key. Starts with `upstack_`.
    pixelId:
      type: apiKey
      in: header
      name: x-pixel-id
      description: The pixel id the request targets.

````