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

# List knowledge bases

> Lists your knowledge bases, newest first.

<Note>
By default only the top level is listed, or the folder in `folderId`. Send `flat=true` to list every knowledge base.
</Note>




## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v1/knowledge-bases
openapi: 3.1.0
info:
  title: Zero Runtime REST API
  version: '1.0'
  description: >-
    Create, configure, version and deploy agents, and wire SIP telephony to
    them.
servers:
  - url: https://api.zeroruntime.ai
security:
  - token: []
tags:
  - name: Agents
  - name: Versions
  - name: Deployment
  - name: Phone numbers
  - name: Routing rules
  - name: Calls
  - name: Batch calls
  - name: Knowledge bases
  - name: Knowledge base folders
paths:
  /v1/knowledge-bases:
    get:
      tags:
        - Knowledge bases
      summary: List knowledge bases
      description: >
        Lists your knowledge bases, newest first.


        <Note>

        By default only the top level is listed, or the folder in `folderId`.
        Send `flat=true` to list every knowledge base.

        </Note>
      parameters:
        - name: flat
          in: query
          description: >-
            `true` lists every knowledge base, whatever folder it's in. Without
            it, the first page also includes the level's folders ahead of the
            knowledge bases.
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: perPage
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 15
        - name: search
          in: query
          description: Case-insensitive match on the name or `knowledgeId`.
          schema:
            type: string
        - name: type
          in: query
          description: Only these types. Repeat it for several.
          schema:
            type: string
            enum:
              - pdf
              - txt
              - csv
              - json
              - docx
              - md
              - url
        - name: status
          in: query
          description: Only these statuses. Repeat it for several.
          schema:
            type: string
            enum:
              - processing
              - ready
              - failed
        - name: folderId
          in: query
          description: List this folder's contents.
          schema:
            type: string
      responses:
        '200':
          description: A page of knowledge bases.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/KnowledgeBase'
                  pageInfo:
                    $ref: '#/components/schemas/PageInfo'
              example:
                data:
                  - knowledgeId: k7x2m
                    name: pricing.pdf
                    type: pdf
                    status: ready
                    statusReason: null
                    failureCode: null
                    sizeInBytes: 482113
                    pageCount: 12
                    sectionCount: 48
                    charCount: 61204
                    folderId: null
                    currentVersion: 1
                    latestVersion: 1
                    createdAt: '2026-10-13T09:30:00.000Z'
                    updatedAt: '2026-10-13T09:30:41.000Z'
                pageInfo:
                  currentPage: 1
                  perPage: 15
                  lastPage: 1
                  total: 1
        '400':
          description: A query parameter is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeBaseValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    KnowledgeBase:
      type: object
      description: Status and size fields describe the current version.
      properties:
        knowledgeId:
          type: string
          description: 5 characters
          lowercase letters and digits. Attach it to an agent with `knowledgeBaseIds`.: null
          example: k7x2m
        name:
          type: string
          example: pricing.pdf
        type:
          type: string
          enum:
            - pdf
            - txt
            - csv
            - json
            - docx
            - md
            - url
        status:
          $ref: '#/components/schemas/KnowledgeBaseStatus'
        statusReason:
          type:
            - string
            - 'null'
          description: Why processing failed.
        failureCode:
          type:
            - string
            - 'null'
          description: For example `upload_failed` or `job_not_scheduled`.
        sizeInBytes:
          type:
            - integer
            - 'null'
          description: '`0` for website knowledge bases.'
        pageCount:
          type:
            - integer
            - 'null'
        sectionCount:
          type:
            - integer
            - 'null'
        charCount:
          type:
            - integer
            - 'null'
        folderId:
          type:
            - string
            - 'null'
          description: '`null` when it''s at the top level.'
        currentVersion:
          type: integer
          description: The version agents read from.
        latestVersion:
          type: integer
          description: The newest version. It may still be processing
          or may have failed.: null
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PageInfo:
      type: object
      properties:
        currentPage:
          type: integer
          example: 1
        perPage:
          type: integer
          example: 20
        lastPage:
          type: integer
          example: 1
        total:
          type: integer
          example: 2
    KnowledgeBaseValidationError:
      type: object
      properties:
        message:
          type: string
          example: Invalid payload
        errors:
          type: object
          description: Every problem found, grouped by field.
          properties:
            formErrors:
              type: array
              items:
                type: string
            fieldErrors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
    KnowledgeBaseStatus:
      type: string
      enum:
        - processing
        - ready
        - failed
      description: |
        - `processing`: being parsed and indexed. Not available to agents yet.
        - `ready`: indexed and available to agents.
        - `failed`: processing stopped. `statusReason` says why.
    Error:
      type: object
      properties:
        error:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    token:
      type: apiKey
      in: header
      name: Authorization
      description: Your API token, sent raw (no `Bearer` prefix).
      x-default: <auth-token>

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.