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

# Retrieve multiple queries with optional filtering

> Retrieves a paginated list of query history entries based on the specified filter criteria.
If no filters are provided, all query history entries will be returned.

The response includes query details along with associated metadata attributes for each entry,
plus pagination metadata (total count, page number, page size, total pages).
Filters can be combined to narrow down the selection of queries to retrieve.

Pagination is applied by default with a page size of 10 items. Use the 'page' and 'page_size'
parameters to control pagination.




## OpenAPI

````yaml get /activeviam/query-history/rest/v1/queries
openapi: 3.1.0
info:
  title: Atoti REST services
  version: 6.1.19-SNAPSHOT
servers:
  - description: Generated server url
    url: http://localhost:9090
security: []
tags:
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API
  - description: >
      XML for Analysis (XMLA) endpoint for executing MDX queries and OLAP
      discovery operations.


      This endpoint implements the XMLA protocol which is used by:

      - Microsoft Excel and other OLAP clients

      - Custom BI tools that support XMLA connectivity


      The endpoint supports both text XML and binary XML formats for improved
      performance.
    name: XMLA API
  - description: Definition of REST API to query data from ActivePivot (V10).
    name: Query REST API (V10)
  - description: Definition of REST API to query data from ActivePivot (V9).
    name: Query REST API (V9)
  - description: Implementation of the REST Bulk API of the content server (version 8).
    name: Bulk REST API
  - description: Implementation of the REST API of the content server.
    name: Content Server REST API
  - description: Implementation of the REST API controller for an ActivePivot database.
    name: Database REST API v9
  - description: ' Definition of the REST service returning the list of services exposed by an application.'
    name: Version REST API
  - description: Rest Service providing the discovery information.
    name: Discovery REST API
  - description: JSON Web Token (JWT) endpoint.
    name: JWT API
  - description: >
      Endpoints to retrieve and manage query history.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: Query History REST API (Experimental)
  - description: Description of REST API to configure an ActivePivot application.
    name: Configuration REST API
  - description: API to export the result of MDX queries
    name: Data Export
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results and updates are streamed in Apache Arrow
      format for efficient

      data transfer and processing.
    name: Continuous GAQ Query REST API (Experimental)
  - description: Endpoints for AI-based optimization of Atoti cubes
    name: AI Optimizer
  - description: >
      GetAggregatesQuery (GAQ) REST API for executing OLAP queries.


      This API provides a programmatic way to execute GetAggregatesQuery
      operations

      against Atoti cubes. Results are returned in Apache Arrow format for
      efficient

      data transfer and processing.


      **Note:** This API is experimental and may change in future versions
      without notice.
    name: GAQ Query REST API (Experimental)
  - description: Implementation of the REST Bulk API of the content server.
    name: Bulk REST API
paths:
  /activeviam/query-history/rest/v1/queries:
    get:
      tags:
        - Query History REST API (Experimental)
      summary: Retrieve multiple queries with optional filtering
      description: >
        Retrieves a paginated list of query history entries based on the
        specified filter criteria.

        If no filters are provided, all query history entries will be returned.


        The response includes query details along with associated metadata
        attributes for each entry,

        plus pagination metadata (total count, page number, page size, total
        pages).

        Filters can be combined to narrow down the selection of queries to
        retrieve.


        Pagination is applied by default with a page size of 10 items. Use the
        'page' and 'page_size'

        parameters to control pagination.
      operationId: getQueries
      parameters:
        - description: 'Page number (0-indexed). Default: 0'
          example: 0
          in: query
          name: page
          schema:
            type: integer
            default: 0
        - description: 'Number of items per page. Default: 10'
          example: 10
          in: query
          name: page_size
          schema:
            type: integer
            default: 10
        - description: >-
            Filter by username(s). Can be a single value or JSON array like
            ["user1", "user2"]
          example:
            - jane.smith
            - john.doe
          in: query
          name: user
          schema:
            type: string
        - description: >-
            Filter by query status(es). Can be a single value or JSON array.
            Valid values: RUNNING, SUCCESSFUL, FAILED, CANCELLED
          example:
            - RUNNING
            - SUCCESSFUL
          in: query
          name: status
          schema:
            type: string
        - description: >-
            Filter by query type(s). Can be a single value or JSON array. Valid
            values: MDX, UNKNOWN
          example:
            - MDX
            - UNKNOWN
          in: query
          name: type
          schema:
            type: string
        - description: Only include queries started after this ISO-8601 date/time
          example: '2025-01-01T10:00:00Z'
          in: query
          name: started_after
          schema:
            format: date-time
            type: string
        - description: Only include queries started before this ISO-8601 date/time
          example: '2025-12-31T23:59:59Z'
          in: query
          name: started_before
          schema:
            format: date-time
            type: string
        - description: Only include queries ended after this ISO-8601 date/time
          example: '2025-01-01T10:00:00Z'
          in: query
          name: ended_after
          schema:
            format: date-time
            type: string
        - description: Only include queries ended before this ISO-8601 date/time
          example: '2025-12-31T23:59:59Z'
          in: query
          name: ended_before
          schema:
            format: date-time
            type: string
        - description: >-
            Maximum duration in milliseconds or ISO-8601 duration format (e.g.,
            PT1H30M for 1 hour 30 minutes)
          example: PT5M
          in: query
          name: max_duration
          schema:
            type: string
        - description: Minimum duration in milliseconds or ISO-8601 duration format
          example: 1000
          in: query
          name: min_duration
          schema:
            type: string
        - description: >
            Filter by metadata attributes using the pattern
            'metadata.{attributeName}'.

            Can be a single value or JSON array. For example:
            metadata.foo=["value1", "value2"]
          example: metadata.foo=["abc1", "abc3"]
          in: query
          name: metadata.*
          schema:
            type: string
        - in: query
          name: arg0
          required: true
          schema:
            $ref: '#/components/schemas/MultiValueMapStringString'
      responses:
        '200':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaginatedQueryHistoryResponse'
          description: >-
            Paginated list of query history entries retrieved successfully.
            Response includes data array and pagination metadata (pageNumber,
            pageSize, totalItems, totalPages).
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaginatedQueryHistoryResponse'
          description: Bad request - invalid filter parameters or date format
components:
  schemas:
    MultiValueMapStringString:
      additionalProperties:
        items:
          type: string
        type: array
      properties:
        all:
          additionalProperties:
            type: string
          type: object
          writeOnly: true
        empty:
          type: boolean
      type: object
    PaginatedQueryHistoryResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/QueryHistoryDto'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMetadata'
      type: object
    QueryHistoryDto:
      properties:
        endDate:
          format: date-time
          type: string
        id:
          type: string
        nodeName:
          type: string
        query:
          type: string
        queryMetadata:
          additionalProperties:
            type: string
          type: object
        startDate:
          format: date-time
          type: string
        status:
          enum:
            - CANCELLED
            - FAILED
            - RUNNING
            - SUCCESSFUL
          type: string
        traceId:
          type: string
        type:
          enum:
            - MDX
            - UNKNOWN
          type: string
        username:
          type: string
      type: object
    PaginationMetadata:
      properties:
        pageNumber:
          format: int32
          type: integer
        pageSize:
          format: int32
          type: integer
        totalItems:
          format: int64
          type: integer
        totalPages:
          format: int32
          type: integer
      type: object

````