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

# Dashboard stats

> Aggregate totals for the caller's org scope (knowledge bases,
documents by status, vectors, web sources, storage bytes).




## OpenAPI

````yaml /api-reference/storage/swagger.yml get /v1/stats
openapi: 3.0.3
info:
  version: 1.0.0
  title: Knowledges API
  description: >
    Public REST API for the Prisme.ai Knowledges (storage) workspace: knowledge
    bases, documents (uploaded files, web pages, remote files, connector
    documents), recurring web-crawl sources, semantic search, access control,
    per-knowledge-base API keys, and skills.


    Resource identifiers use the physical prefixes emitted by the implementation
    (`vs_` knowledge base, `vsf_` document, `seed_` web source, `kb-` API-key
    slug).


    This spec documents the public REST surface only. Internal helpers (private
    automations prefixed with `_`) and admin/GDPR lifecycle operations are not
    part of the public contract.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:storage/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - WorkspaceApiKeyAuth: []
tags:
  - name: Knowledge Bases
    description: >-
      Create, list, read, update, and delete knowledge bases (vector-backed
      document stores).
  - name: Documents
    description: >-
      Ingest and manage documents (uploaded files, web pages, remote files,
      connector documents) and their indexing.
  - name: Web Sources
    description: >-
      Recurring web crawl seeds that discover and index pages into a knowledge
      base.
  - name: Search
    description: Semantic search over a knowledge base.
  - name: Access
    description: Per-knowledge-base access bindings (user, group, org, agent principals).
  - name: API Keys
    description: Per-knowledge-base API keys for connector authentication.
  - name: Stats
    description: Aggregate dashboard statistics.
  - name: Skills
    description: Prompt/instruction registry entries.
paths:
  /v1/stats:
    get:
      tags:
        - Stats
      summary: Dashboard stats
      description: |
        Aggregate totals for the caller's org scope (knowledge bases,
        documents by status, vectors, web sources, storage bytes).
      operationId: getStats
      parameters:
        - name: scope
          in: query
          required: false
          schema:
            type: string
          description: |
            Comma-separated population selector - `own`, `shared`, `all`.
      responses:
        '200':
          description: Stats.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stats'
        '401':
          $ref: '#/components/responses/LegacyError401'
        '403':
          $ref: '#/components/responses/LegacyError403'
      security:
        - BearerAuth: []
components:
  schemas:
    Stats:
      type: object
      description: |
        Dashboard aggregate for the caller's org scope. The
        implementation also returns legacy-named superset fields
        (`totalStores`, `totalDocuments`, `storageUsedBytes`, `scope`)
        alongside those below - additive, safe to ignore.
      additionalProperties: true
      required:
        - object
      properties:
        object:
          type: string
          enum:
            - stats
        knowledge_bases:
          type: integer
          minimum: 0
        documents:
          type: integer
          minimum: 0
        documents_by_status:
          type: object
          additionalProperties:
            type: integer
        vectors:
          type: integer
          minimum: 0
        web_sources:
          type: integer
          minimum: 0
        storage_used_bytes:
          type: integer
          minimum: 0
          description: |
            Real aggregate. (The legacy `stats.storageUsedBytes` was
            dead code returning 0 - see `09` §B2 - fixed when porting.)
  responses:
    LegacyError401:
      description: Authentication missing or invalid (legacy flat envelope).
      content:
        application/json:
          schema:
            type: object
            description: |
              Legacy **flat** error envelope emitted by the not-yet-migrated
              `/v1/skills*`, `/v1/stats`, `/v1/cleanup/*` and
              `/v1/export/by-user` routes (all other routes use the nested
              `Error` envelope). The shape varies by route: `skills`/`stats`
              return `{ error: <message>, code: <CODE> }`; `cleanup`/`export`
              return `{ error: <CODE>, message: <message> }`. Same information,
              different field placement. These routes will migrate to the
              nested `Error` envelope.
            additionalProperties: true
            properties:
              error:
                type: string
              code:
                type: string
              message:
                type: string
    LegacyError403:
      description: Authorization denied (legacy flat envelope).
      content:
        application/json:
          schema:
            type: object
            description: |
              Legacy **flat** error envelope emitted by the not-yet-migrated
              `/v1/skills*`, `/v1/stats`, `/v1/cleanup/*` and
              `/v1/export/by-user` routes (all other routes use the nested
              `Error` envelope). The shape varies by route: `skills`/`stats`
              return `{ error: <message>, code: <CODE> }`; `cleanup`/`export`
              return `{ error: <CODE>, message: <message> }`. Same information,
              different field placement. These routes will migrate to the
              nested `Error` envelope.
            additionalProperties: true
            properties:
              error:
                type: string
              code:
                type: string
              message:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User session JWT or instance API key (`iak_*`). Send as `Authorization:
        Bearer <token>`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: Workspace- or knowledge-base-scoped API key.

````