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

# List vaults

> This endpoint lists all collections, and how many documents are in each collection.
All documents that do not have a collection assigned are in the `null` collection.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml get /vault/list
openapi: 3.1.0
info:
  title: Hyperspell API
  summary: >-
    Hyperspell is the memory layer for AI apps and agents. Through the API, you
    can add memories, connect data sources to index them in real-time, and
    search memories with our natural language query engine.
  termsOfService: https://hyperspell.com/blog/tos
  contact:
    name: Hyperspell
    url: https://hyperspell.com/
    email: hello@hyperspell.com
  version: 0.32.1
servers:
  - url: https://api.hyperspell.com
    description: Production
security:
  - APIKey: []
    AsUser: []
paths:
  /vault/list:
    get:
      tags:
        - Vault
      summary: List vaults
      description: >-
        This endpoint lists all collections, and how many documents are in each
        collection.

        All documents that do not have a collection assigned are in the `null`
        collection.
      operationId: list_vaults_vault_list_get
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - name: size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 0
            default: 50
            title: Size
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorPage_Collection_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Hyperspell from '@hyperspell/hyperspell';

            const client = new Hyperspell({
              apiKey: process.env['HYPERSPELL_API_KEY'], // This is the default and can be omitted
            });

            // Automatically fetches more pages as needed.
            for await (const vaultListResponse of client.vaults.list()) {
              console.log(vaultListResponse.collection);
            }
        - lang: Python
          source: |-
            import os
            from hyperspell import Hyperspell

            client = Hyperspell(
                api_key=os.environ.get("HYPERSPELL_API_KEY"),  # This is the default and can be omitted
            )
            page = client.vaults.list()
            page = page.items[0]
            print(page.collection)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/hyperspell/hyperspell-go\"\n\t\"github.com/hyperspell/hyperspell-go/option\"\n)\n\nfunc main() {\n\tclient := hyperspell.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Vaults.List(context.TODO(), hyperspell.VaultListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: CLI
          source: |-
            hyperspell vaults list \
              --api-key 'My API Key'
components:
  schemas:
    CursorPage_Collection_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/Collection'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
        - next_cursor
      title: CursorPage[Collection]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Collection:
      properties:
        collection:
          anyOf:
            - type: string
            - type: 'null'
          title: Collection
        document_count:
          type: integer
          title: Document Count
      type: object
      required:
        - collection
        - document_count
      title: Collection
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKey:
      type: http
      description: >-
        API Key or JWT User Token. If using an API Key, set the X-As-User header
        to act as a specific user. A JWT User Token is always scoped to a
        specific user.
      scheme: bearer
      bearerFormat: Bearer <token>
    AsUser:
      type: apiKey
      description: >-
        Optionally set this header to act as a specific user when using an API
        Key, equivalent to first exchanging the API Key for a User Token
      in: header
      name: X-As-User

````