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

# Get top queries

> The most frequent search queries of the key's Organization over the window, normalized (lowercased, white space collapsed, at most 200 characters) and counted per hour. Query text is recorded only when the deployment sets observability.record_query_text; otherwise recording is false and the list is empty. Requires observability:read on a key that grants every Corpus.



## OpenAPI

````yaml /openapi.yaml get /v0/admin/stats/top-queries
openapi: 3.1.0
info:
  title: Quivr HTTP API
  version: 0.0.0-draft
  description: >-
    Every endpoint of the Quivr v0 HTTP API. Send an API key as a bearer token;
    the key decides the Organization, the actions and the Corpora a request may
    reach.
servers: []
security:
  - ApiKey: []
paths:
  /v0/admin/stats/top-queries:
    get:
      tags:
        - Admin
      summary: Get top queries
      description: >-
        The most frequent search queries of the key's Organization over the
        window, normalized (lowercased, white space collapsed, at most 200
        characters) and counted per hour. Query text is recorded only when the
        deployment sets observability.record_query_text; otherwise recording is
        false and the list is empty. Requires observability:read on a key that
        grants every Corpus.
      operationId: getTopQueries
      parameters:
        - name: window
          in: query
          required: false
          schema:
            type: string
            enum:
              - 1h
              - 24h
              - 7d
            default: 1h
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopQueryList'
        default:
          description: >-
            Structured error; 401 unauthenticated, 403 without
            observability:read on every Corpus, 422 invalid_window or
            invalid_limit, 503 storage unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TopQueryList:
      type: object
      additionalProperties: false
      properties:
        window:
          $ref: '#/components/schemas/StatsWindowName'
        recording:
          type: boolean
          description: >-
            Whether this deployment records query text
            (observability.record_query_text).
        items:
          type: array
          description: Most frequent first.
          items:
            $ref: '#/components/schemas/TopQuery'
      required:
        - window
        - recording
        - items
    Error:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          minLength: 1
        message:
          type: string
          minLength: 1
        retryable:
          type: boolean
        field:
          type: string
          minLength: 1
          description: >-
            JSON Pointer (RFC 6901) to the request member that caused a 422,
            when known (for example /config/url or /credential/secret/token on
            connector commands).
        resync_url:
          type: string
          format: uri-reference
      required:
        - code
        - message
        - retryable
    StatsWindowName:
      type: string
      enum:
        - 1h
        - 24h
        - 7d
    TopQuery:
      type: object
      additionalProperties: false
      properties:
        query:
          type: string
          minLength: 1
          maxLength: 200
        count:
          type: integer
          minimum: 1
      required:
        - query
        - count
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        API key, not necessarily a JWT. Server derives Organization, permitted
        actions and Corpus scope; every resource access is authorized.

````