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

# List Query History requests

API requests to the deployment, newest first. Covers the deployment's production API requests that queried data (REST, GraphQL, SQL and WebSocket), as the Query History page in Cube Cloud shows them; requests to development branches and metadata calls are left out. How far back it reaches is the deployment's Query History retention. Filters combine with AND. A page holds up to 200 requests (100 by default). An `endCursor` keeps its first page's filters: with `after`, the other filters are ignored. Open a request with `GET …/query-history/requests/{id}` to see the SQL it generated.


## OpenAPI

````yaml /api-reference/api.yaml get /api/v1/deployments/{deploymentId}/query-history/requests
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Databricks Metric View Publication
  - name: Databricks Metric View Integration
  - name: Snowflake Semantic View Sync
  - name: Folders
  - name: Reports
  - name: External Documents
  - name: Workbooks
  - name: Workbook Promotions
  - name: Dashboard Exports
  - name: Notifications
  - name: Scheduled Tasks
  - name: Workspace
  - name: Agents
  - name: Users
  - name: Users Admin
  - name: API Keys
  - name: Roles
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: Usage Analytics
  - name: OpenAPI Spec
  - name: Audit Log
  - name: Chat History
  - name: Data Model History
  - name: Ossie Conversion
  - name: Query History
  - name: Report Deliveries
paths:
  /api/v1/deployments/{deploymentId}/query-history/requests:
    get:
      tags:
        - Query History
      summary: List Query History requests
      operationId: listQueryHistoryRequests
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: query
          name: from
          schema:
            description: >-
              Only requests at or after this ISO 8601 date or date-time, UTC
              unless it names a zone. Defaults to 24 hours before `to`. A window
              that starts earlier than the deployment’s Query History retention
              answers `400`.
            oneOf:
              - pattern: >-
                  ^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$
                type: string
              - type: 'null'
        - in: query
          name: to
          schema:
            description: >-
              Only requests at or before this ISO 8601 date-time, UTC unless it
              names a zone. A date alone (`2026-10-01`) includes that whole day.
              Defaults to now.
            oneOf:
              - pattern: >-
                  ^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?$
                type: string
              - type: 'null'
        - in: query
          name: status
          schema:
            description: >-
              `success`, `error`, `running` (no response yet), or `noResponse`
              (no response, and silent for five minutes).
            oneOf:
              - $ref: '#/components/schemas/QueryHistoryRequestsQueryStatus'
              - type: 'null'
        - in: query
          name: apiType
          schema:
            description: >-
              The API the request came in on. Repeat the parameter to match any
              of several.
            oneOf:
              - items:
                  type: string
                  enum:
                    - rest
                    - graphql
                    - sql
                    - ws
                type: array
                maxItems: 4
              - type: 'null'
        - in: query
          name: minDurationMs
          schema:
            description: Only requests that took at least this many milliseconds.
            oneOf:
              - minimum: 0
                type: integer
              - type: 'null'
        - in: query
          name: search
          schema:
            description: >-
              A substring of the query, the security context, the request id or
              the span id.
            oneOf:
              - maxLength: 1000
                type: string
              - type: 'null'
        - in: query
          name: after
          schema:
            type: string
        - in: query
          name: first
          schema:
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryHistoryRequestListResponse'
          description: ''
components:
  schemas:
    QueryHistoryRequestsQueryStatus:
      enum:
        - success
        - error
        - running
        - noResponse
      type: string
    QueryHistoryRequestListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/QueryHistoryRequest'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
      required:
        - items
        - pageInfo
      type: object
    QueryHistoryRequest:
      properties:
        apiType:
          description: '`rest`, `graphql`, `sql` or `ws`.'
          oneOf:
            - type: string
            - type: 'null'
        cacheType:
          description: >-
            Where the answer came from: `cube` (a pre-aggregation in Cube
            Store), `cube-suboptimal` (Cube Store with a suboptimal plan),
            `base` (the data source), `internal` (Cube’s in-memory cache) or
            `none`.
          type: string
        durationMs:
          description: Time to the API response.
          oneOf:
            - type: number
            - type: 'null'
        error:
          oneOf:
            - type: string
            - type: 'null'
        id:
          description: >-
            Pass to `GET …/query-history/requests/{id}`. It is the id in the
            request’s Query History link in Cube Cloud, not `requestId`.
          type: string
        isPlayground:
          type: boolean
        isSubscription:
          type: boolean
        preAggregations:
          description: The pre-aggregations the request used, as APM recorded them.
          oneOf:
            - type: string
            - type: 'null'
        query:
          description: 'The query as the API received it: REST query JSON, or the SQL text.'
          oneOf:
            - type: string
            - type: 'null'
        requestId:
          description: The request id the client sent or Cube assigned.
          type: string
        responseBytes:
          oneOf:
            - type: number
            - type: 'null'
        securityContext:
          description: The security context JSON.
          oneOf:
            - type: string
            - type: 'null'
        spanId:
          type: string
        status:
          $ref: '#/components/schemas/QueryHistoryRequestStatus'
          description: >-
            `success`, `error`, `running` (no response yet), or `noResponse` (no
            response, and silent for five minutes).
        timestamp:
          description: When the request arrived, ISO 8601 UTC.
          type: string
        usedPreAggregations:
          type: boolean
      required:
        - id
        - requestId
        - spanId
        - timestamp
        - status
        - cacheType
        - usedPreAggregations
        - isPlayground
        - isSubscription
      type: object
    PageInfo:
      properties:
        endCursor:
          oneOf:
            - type: string
            - type: 'null'
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - hasNextPage
        - hasPreviousPage
      type: object
    QueryHistoryRequestStatus:
      enum:
        - success
        - error
        - running
        - noResponse
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````

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