> ## 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 search stats

> Searches of the key's Organization over the window per mode and search profile, with errors, latency and the number of results returned, in the buckets of getPluginCallStats. The profile is unknown for a search that named a profile the deployment does not serve. Requires observability:read on a key that grants every Corpus.



## OpenAPI

````yaml /openapi.yaml get /v0/admin/stats/searches
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/searches:
    get:
      tags:
        - Admin
      summary: Get search stats
      description: >-
        Searches of the key's Organization over the window per mode and search
        profile, with errors, latency and the number of results returned, in the
        buckets of getPluginCallStats. The profile is unknown for a search that
        named a profile the deployment does not serve. Requires
        observability:read on a key that grants every Corpus.
      operationId: getSearchStats
      parameters:
        - name: window
          in: query
          required: false
          schema:
            type: string
            enum:
              - 1h
              - 24h
              - 7d
            default: 1h
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchStatsList'
        default:
          description: >-
            Structured error; 401 unauthenticated, 403 without
            observability:read on every Corpus, 422 invalid_window, 503 storage
            unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SearchStatsList:
      type: object
      additionalProperties: false
      properties:
        window:
          $ref: '#/components/schemas/StatsWindowName'
        resolution_seconds:
          type: integer
          minimum: 1
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        items:
          type: array
          items:
            $ref: '#/components/schemas/SearchStats'
      required:
        - window
        - resolution_seconds
        - from
        - to
        - 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
    SearchStats:
      type: object
      additionalProperties: false
      properties:
        mode:
          type: string
          enum:
            - lexical
            - semantic
            - hybrid
        profile:
          type: string
          minLength: 1
        results:
          type: integer
          minimum: 0
          description: Results returned by these searches in total.
        summary:
          $ref: '#/components/schemas/StatsSummary'
        points:
          type: array
          description: Non-empty buckets, oldest first.
          items:
            $ref: '#/components/schemas/StatsPoint'
      required:
        - mode
        - profile
        - results
        - summary
        - points
    StatsSummary:
      type: object
      additionalProperties: false
      description: >-
        A series over the whole window. Latencies are in milliseconds and
        present only when count is positive.
      properties:
        count:
          type: integer
          minimum: 0
        errors:
          type: integer
          minimum: 0
        p50_ms:
          type: number
          minimum: 0
        p95_ms:
          type: number
          minimum: 0
        mean_ms:
          type: number
          minimum: 0
        last_error_code:
          type: string
          minLength: 1
        last_error_at:
          type: string
          format: date-time
      required:
        - count
        - errors
    StatsPoint:
      type: object
      additionalProperties: false
      description: >-
        One non-empty bucket, starting at start and lasting the list's
        resolution_seconds.
      properties:
        start:
          type: string
          format: date-time
        count:
          type: integer
          minimum: 1
        errors:
          type: integer
          minimum: 0
        p50_ms:
          type: number
          minimum: 0
        p95_ms:
          type: number
          minimum: 0
      required:
        - start
        - count
        - errors
        - p50_ms
        - p95_ms
  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.

````