Lightdash Query API

These routes allow users to execute and manage queries against their data warehouse. This includes metric queries, SQL queries, and retrieving query results.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

lightdash-query-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Lightdash AiAgents Query API
  version: 0.3156.1
  description: 'Open API documentation for all public Lightdash API endpoints. # Authentication Before you get started, you might need to create a Personal Access Token to authenticate via the API. You can create a token by following this guide: https://docs.lightdash.com/references/personal_tokens

    '
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
- url: /
tags:
- name: Query
  description: These routes allow users to execute and manage queries against their data warehouse. This includes metric queries, SQL queries, and retrieving query results.
paths:
  /api/v2/projects/{projectUuid}/query/{queryUuid}:
    get:
      operationId: getAsyncQueryResults
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGetAsyncQueryResultsResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Retrieves paginated results from a previously executed async query using its UUID
      summary: Get results
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      - description: The UUID of the async query to retrieve results for
        in: path
        name: queryUuid
        required: true
        schema:
          type: string
      - description: Page number for pagination (starts at 1)
        in: query
        name: page
        required: false
        schema:
          format: double
          type: number
      - description: 'Number of results per page (default: 500, max: 5000)'
        in: query
        name: pageSize
        required: false
        schema:
          format: double
          type: number
  /api/v2/projects/{projectUuid}/query/{queryUuid}/cancel:
    post:
      operationId: cancelAsyncQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccessEmpty'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Cancels a running async query and discards any partial results
      summary: Cancel query
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      - description: The UUID of the async query to cancel
        in: path
        name: queryUuid
        required: true
        schema:
          type: string
  /api/v2/projects/{projectUuid}/query/{queryUuid}/calculate-total:
    post:
      operationId: executeAsyncCalculateTotal
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncMetricQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Calculates totals for a previously-executed query, referenced by its queryUuid. Re-runs the source query's MetricQuery against the warehouse so totals are correct for every metric type (count distinct, average, ratio, etc.) — unlike client-side cell summation, which only works for sum/count. The requested `kind` selects which totals to compute.
      summary: Calculate totals
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      - description: The UUID of the previously-executed query to compute totals from
        in: path
        name: queryUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncCalculateTotalRequestParams'
  /api/v2/projects/{projectUuid}/query/metric-query:
    post:
      operationId: executeAsyncMetricQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncMetricQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a metric query asynchronously against your data warehouse using dimensions, metrics, filters, and sorts
      summary: Execute metric query
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncMetricQueryRequestParams'
  /api/v2/projects/{projectUuid}/query/field-values:
    post:
      operationId: executeAsyncFieldValueSearch
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncFieldValueSearchResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Searches for unique field values asynchronously, returning a query UUID to poll for results
      summary: Search field values
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncFieldValueSearchRequestParams'
  /api/v2/projects/{projectUuid}/query/chart:
    post:
      operationId: executeAsyncSavedChartQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncMetricQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a saved chart query asynchronously with optional parameter overrides
      summary: Execute saved chart
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncSavedChartRequestParams'
  /api/v2/projects/{projectUuid}/query/dashboard-chart:
    post:
      operationId: executeAsyncDashboardChartQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncDashboardChartQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a chart within a dashboard context asynchronously with inherited dashboard filters
      summary: Execute dashboard chart
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncDashboardChartRequestParams'
  /api/v2/projects/{projectUuid}/query/underlying-data:
    post:
      operationId: executeAsyncUnderlyingDataQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncMetricQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a query to retrieve underlying raw data for drilling down into aggregated values
      summary: Execute underlying data
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncUnderlyingDataRequestParams'
  /api/v2/projects/{projectUuid}/query/sql:
    post:
      operationId: executeAsyncSqlQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncSqlQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a raw SQL query asynchronously against your data warehouse for custom queries
      summary: Execute SQL query
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncSqlQueryRequestParams'
  /api/v2/projects/{projectUuid}/query/sql-chart:
    post:
      operationId: executeAsyncSqlChartQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncSqlQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a saved SQL chart query asynchronously with optional chart configurations
      summary: Execute SQL chart
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncSqlChartRequestParams'
  /api/v2/projects/{projectUuid}/query/dashboard-sql-chart:
    post:
      operationId: executeAsyncDashboardSqlChartQuery
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiExecuteAsyncDashboardSqlChartQueryResults_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Executes a SQL chart within a dashboard context asynchronously with inherited filters
      summary: Execute dashboard SQL chart
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExecuteAsyncDashboardSqlChartRequestParams'
  /api/v2/projects/{projectUuid}/query/{queryUuid}/download:
    post:
      operationId: downloadResults
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiSuccess_ApiDownloadAsyncQueryResults-or-ApiDownloadAsyncQueryResultsAsCsv-or-ApiDownloadAsyncQueryResultsAsXlsx_'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Downloads query results in various formats with custom formatting options
      summary: Download results
      tags:
      - Query
      deprecated: true
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      - description: The UUID of the completed async query to download
        in: path
        name: queryUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Omit_DownloadAsyncQueryResultsRequestParams.queryUuid_'
  /api/v2/projects/{projectUuid}/query/{queryUuid}/schedule-download:
    post:
      operationId: scheduleDownloadResults
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiJobScheduledResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      description: Downloads query results in various formats with custom formatting options
      summary: Download results
      tags:
      - Query
      security: []
      parameters:
      - in: path
        name: projectUuid
        required: true
        schema:
          type: string
      - description: The UUID of the completed async query to download
        in: path
        name: queryUuid
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Omit_DownloadAsyncQueryResultsRequestParams.queryUuid_'
components:
  schemas:
    DateZoom:
      properties:
        xAxisFieldId:
          type: string
        granularity:
          anyOf:
          - $ref: '#/components/schemas/DateGranularity'
          - type: string
      type: object
    ApiDownloadAsyncQueryResults:
      properties:
        fileUrl:
          type: string
      required:
      - fileUrl
      type: object
    ApiExecuteAsyncMetricQueryResults:
      allOf:
      - $ref: '#/components/schemas/ApiExecuteAsyncQueryResultsCommon'
      - properties:
          warnings:
            items:
              $ref: '#/components/schemas/QueryWarning'
            type: array
          fields:
            $ref: '#/components/schemas/ItemsMap'
          metricQuery:
            $ref: '#/components/schemas/MetricQuery'
        required:
        - warnings
        - fields
        - metricQuery
        type: object
    ApiSuccess_ApiDownloadAsyncQueryResults-or-ApiDownloadAsyncQueryResultsAsCsv-or-ApiDownloadAsyncQueryResultsAsXlsx_:
      properties:
        results:
          anyOf:
          - $ref: '#/components/schemas/ApiDownloadAsyncQueryResults'
          - $ref: '#/components/schemas/ApiDownloadAsyncQueryResultsAsCsv'
          - $ref: '#/components/schemas/ApiDownloadAsyncQueryResultsAsXlsx'
        status:
          type: string
          enum:
          - ok
          nullable: false
      required:
      - results
      - status
      type: object
    FieldUrl:
      properties:
        label:
          type: string
        url:
          type: string
      required:
      - label
      - url
      type: object
    ApiExecuteAsyncFieldValueSearchResults:
      properties:
        cacheMetadata:
          $ref: '#/components/schemas/CacheMetadata'
        queryUuid:
          type: string
      required:
      - cacheMetadata
      - queryUuid
      type: object
    DashboardTileTarget:
      anyOf:
      - $ref: '#/components/schemas/DashboardFieldTarget'
      - type: boolean
        enum:
        - false
    ApiExecuteAsyncQueryResultsCommon:
      properties:
        resolvedTimezone:
          type: string
          nullable: true
        usedParametersValues:
          $ref: '#/components/schemas/ParametersValuesMap'
        parameterReferences:
          items:
            type: string
          type: array
        cacheMetadata:
          $ref: '#/components/schemas/CacheMetadata'
        queryUuid:
          type: string
      required:
      - resolvedTimezone
      - usedParametersValues
      - parameterReferences
      - cacheMetadata
      - queryUuid
      type: object
    DateGranularity:
      enum:
      - Second
      - Minute
      - Hour
      - Day
      - Week
      - Month
      - Quarter
      - Year
      type: string
    ReadyQueryResultsPage:
      allOf:
      - $ref: '#/components/schemas/ResultsPaginationMetadata_ResultRow_'
      - properties:
          pivotDetails:
            properties:
              passthroughDimensions:
                items:
                  $ref: '#/components/schemas/GroupByColumn'
                type: array
              originalColumns:
                $ref: '#/components/schemas/ResultColumns'
              sortBy:
                $ref: '#/components/schemas/SortBy'
              groupByColumns:
                items:
                  $ref: '#/components/schemas/GroupByColumn'
                type: array
              valuesColumns:
                items:
                  $ref: '#/components/schemas/PivotValuesColumn'
                type: array
              indexColumn:
                anyOf:
                - $ref: '#/components/schemas/PivotIndexColum'
                - items:
                    $ref: '#/components/schemas/PivotIndexColum'
                  type: array
              totalColumnCount:
                type: number
                format: double
                nullable: true
            required:
            - originalColumns
            - valuesColumns
            - totalColumnCount
            type: object
            nullable: true
          status:
            $ref: '#/components/schemas/QueryHistoryStatus.READY'
          metadata:
            $ref: '#/components/schemas/QueryResultsMetadata'
          rows:
            items:
              $ref: '#/components/schemas/ResultRow'
            type: array
          columns:
            $ref: '#/components/schemas/ResultColumns'
          queryUuid:
            type: string
        required:
        - pivotDetails
        - status
        - metadata
        - rows
        - columns
        - queryUuid
        type: object
    Pick_CompiledDimension.name-or-label-or-table_:
      properties: {}
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    PivotConfiguration:
      properties:
        pivotColumnsOrder:
          items:
            $ref: '#/components/schemas/GroupByColumn'
          type: array
          description: 'Declared order of the pivot-column dimensions (visible `groupByColumns`

            plus hidden `sortOnlyDimensions`) as they appear in the chart''s

            `pivotConfig.columns`. `column_ranking` orders columns by this sequence so

            a hidden sort-only dim sorts at its DECLARED position — hiding a dim then

            leaves column order identical to when it was visible, instead of hoisting

            the hidden dim to the front of the ORDER BY. Passthrough (hidden, non-sort)

            dims are excluded since they don''t drive sort. When omitted, ordering falls

            back to hoisting sort-only sort targets to the front (legacy behavior).'
        passthroughDimensions:
          items:
            $ref: '#/components/schemas/GroupByColumn'
          type: array
          description: 'Hidden pivot-column dimensions that are NOT sort targets but still need

            their values carried through the SQL pipeline so that other fields''

            `richText` / `image:` templates can reference them via

            `row.<table>.<field>.raw`. They participate in `group_by_query` SELECT

            and GROUP BY (same as sortOnlyDimensions) but do NOT affect

            `column_ranking` ORDER BY (they don''t drive sort). Without this bucket

            the dim would be dropped entirely from the query and `row.*.raw`

            references would silently resolve to undefined.'
        sortOnlyDimensions:
          items:
            $ref: '#/components/schemas/GroupByColumn'
          type: array
          description: 'Dimensions referenced by ORDER BY but NOT spread into pivot columns.

            Used when a user hides a dim that''s part of `pivotConfig.columns` and has

            a sort entry on it: the dim still ranks column order via the GROUP BY /

            ORDER BY pipeline, but it doesn''t become a pivot column header level.

            Mirrors `sortOnlyColumns` (which serves the same purpose for metrics).'
        sortOnlyColumns:
          items:
            $ref: '#/components/schemas/ValuesColumn'
          type: array
          description: 'Metrics/table calculations needed for sort anchor CTEs but not for display.

            These are merged into valuesColumns for SQL generation in PivotQueryBuilder,

            but excluded from pivotDetails so they don''t appear as chart series.'
        metricsAsRows:
          type: boolean
          description: 'When true, metrics are displayed as rows instead of columns.

            This affects column limit calculation - when metrics are rows,

            we don''t need to divide the column limit by the number of metrics.

            Defaults to false for backward compatibility (SQL runner behavior).'
        sortBy:
          $ref: '#/components/schemas/SortBy'
        groupByColumns:
          items:
            $ref: '#/components/schemas/GroupByColumn'
          type: array
        valuesColumns:
          items:
            $ref: '#/components/schemas/ValuesColumn'
          type: array
        indexColumn:
          anyOf:
          - $ref: '#/components/schemas/PivotIndexColum'
          - items:
              $ref: '#/components/schemas/PivotIndexColum'
            type: array
      required:
      - valuesColumns
      type: object
    Metric:
      properties:
        fieldType:
          $ref: '#/components/schemas/FieldType.METRIC'
        type:
          $ref: '#/components/schemas/MetricType'
        name:
          type: string
        label:
          type: string
        table:
          type: string
        tableLabel:
          type: string
        sql:
          type: string
        description:
          type: string
        source:
          $ref: '#/components/schemas/Source'
        hidden:
          type: boolean
        compact:
          $ref: '#/components/schemas/CompactOrAlias'
        round:
          type: number
          format: double
        format:
          anyOf:
          - $ref: '#/components/schemas/Format'
          - type: string
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: 'Number separator style for grouping/decimal characters. Composes with

            `format` (including ECMA-376 expressions) and `formatOptions` — it only

            controls the separator characters, not the format shape.'
        groupLabel:
          type: string
          deprecated: true
        groups:
          items:
            type: string
          type: array
        urls:
          items:
            $ref: '#/components/schemas/FieldUrl'
          type: array
        index:
          type: number
          format: double
        tags:
          items:
            type: string
          type: array
        parameterReferences:
          items:
            type: string
          type: array
        showUnderlyingValues:
          items:
            type: string
          type: array
        filters:
          items:
            $ref: '#/components/schemas/MetricFilterRule'
          type: array
        percentile:
          type: number
          format: double
        distinctKeys:
          items:
            type: string
          type: array
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
        dimensionReference:
          type: string
        requiredAttributes:
          $ref: '#/components/schemas/Record_string.string-or-string-Array_'
        anyAttributes:
          $ref: '#/components/schemas/Record_string.string-or-string-Array_'
        defaultTimeDimension:
          $ref: '#/components/schemas/DefaultTimeDimension'
        spotlight:
          properties:
            owner:
              type: string
            defaultFilter:
              $ref: '#/components/schemas/MetricFilterRule'
            defaultSegment:
              type: string
            segmentBy:
              items:
                type: string
              type: array
            filterBy:
              items:
                type: string
              type: array
            categories:
              items:
                type: string
              type: array
            visibility:
              type: string
              enum:
              - show
              - hide
          required:
          - visibility
          type: object
        drivers:
          items:
            type: string
          type: array
        aiHint:
          anyOf:
          - type: string
          - items:
              type: string
            type: array
        richText:
          type: string
      required:
      - fieldType
      - type
      - name
      - label
      - table
      - tableLabel
      - sql
      - hidden
      type: object
      additionalProperties: true
    CommonExecuteQueryRequestParams:
      properties:
        parameters:
          $ref: '#/components/schemas/ParametersValuesMap'
        usePreAggregateCache:
          type: boolean
        invalidateCache:
          type: boolean
        context:
          $ref: '#/components/schemas/QueryExecutionContext'
      type: object
    PreAggregateMissReason.NO_PRE_AGGREGATES_DEFINED:
      enum:
      - no_pre_aggregates_defined
      type: string
    QueryResultsPerformance:
      properties:
        queueTimeMs:
          type: number
          format: double
          nullable: true
        resultsPageExecutionMs:
          type: number
          format: double
        initialQueryExecutionMs:
          type: number
          format: double
          nullable: true
      required:
      - queueTimeMs
      - resultsPageExecutionMs
      - initialQueryExecutionMs
      type: object
    FieldType.METRIC:
      enum:
      - metric
      type: string
    FilterGroup:
      anyOf:
      - $ref: '#/components/schemas/OrFilterGroup'
      - $ref: '#/components/schemas/AndFilterGroup'
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
          - name
          - statusCode
          type: object
        status:
          type: string
          enum:
          - error
          nullable: false
      required:
      - error
      - status
      type: object
      description: 'The Error object is returned from the api any time there is an error.

        The message contains'
    Pick_Metric.formatOptions_:
      properties:
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    ResultRow:
      $ref: '#/components/schemas/Record_string._value-ResultValue__'
    ItemsMap:
      $ref: '#/components/schemas/Record_string.Field-or-TableCalculation-or-CustomDimension-or-Metric_'
    Pick_Dimension.formatOptions_:
      properties:
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    ApiSuccess_ApiExecuteAsyncDashboardSqlChartQueryResults_:
      properties:
        results:
          $ref: '#/components/schemas/ApiExecuteAsyncDashboardSqlChartQueryResults'
        status:
          type: string
          enum:
          - ok
          nullable: false
      required:
      - results
      - status
      type: object
    ExecuteAsyncFieldValueSearchRequestParams:
      allOf:
      - $ref: '#/components/schemas/CommonExecuteQueryRequestParams'
      - properties:
          forceRefresh:
            type: boolean
          filters:
            $ref: '#/components/schemas/AndFilterGroup'
          limit:
            type: number
            format: double
          search:
            type: string
          fieldId:
            type: string
          table:
            type: string
        required:
        - search
        - fieldId
        - table
        type: object
    OrFilterGroup:
      properties:
        or:
          items:
            $ref: '#/components/schemas/FilterGroupItem'
          type: array
          description: Array of filters or nested groups combined with OR logic
        id:
          type: string
          description: Unique identifier for the filter group
      required:
      - or
      - id
      type: object
    FixedWidthBinDimension:
      properties:
        id:
          type: string
          description: Unique identifier for the custom dimension
        name:
          type: string
          description: Display name for the custom dimension
        table:
          type: string
          description: Table this custom dimension belongs to
        type:
          $ref: '#/components/schemas/CustomDimensionType.BIN'
          description: Type of custom dimension (bin or sql)
        dimensionId:
          $ref: '#/components/schemas/FieldId'
          description: Field ID of the parent dimension to bin
        binType:
          $ref: '#/components/schemas/BinType.FIXED_WIDTH'
        binWidth:
          type: number
          format: double
      required:
      - id
      - name
      - table
      - type
      - dimensionId
      - binType
      - binWidth
      type: object
      additionalProperties: true
    QueryWarning:
      properties:
        tables:
          items:
            type: string
          type: array
        fields:
          items:
            type: string
          type: array
        message:
          type: string
      required:
      - message
      type: object
    PreAggregateMissReason.NON_ADDITIVE_METRIC:
      enum:
      - non_additive_metric
      type: string
    QueryHistoryStatus.QUEUED:
      enum:
      - queued
      type: string
    DimensionOverrides:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/Pick_Dimension.formatOptions_'
      type: object
    BinType.FIXED_NUMBER:
      enum:
      - fixed_number
      type: string
    ApiGetAsyncQueryResults:
      anyOf:
      - $ref: '#/components/schemas/ReadyQueryResultsPage'
      - properties:
          queryUuid:
            type: string
          status:
            anyOf:
            - $ref: '#/components/schemas/QueryHistoryStatus.PENDING'
            - $ref

# --- truncated at 32 KB (93 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lightdash/refs/heads/main/openapi/lightdash-query-api-openapi.yml