> ## 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 folders

> Lists every folder as a flat list, shallowest first and then by name. Rebuild the tree from `parentId`.



## OpenAPI

````yaml /api-reference/rest/openapi.yaml get /v1/knowledge-bases/folders
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/folders:
    get:
      tags:
        - Knowledge base folders
      summary: List folders
      description: >-
        Lists every folder as a flat list, shallowest first and then by name.
        Rebuild the tree from `parentId`.
      responses:
        '200':
          description: The folders.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/KnowledgeFolder'
                  unfiledCount:
                    type: integer
                    description: Knowledge bases at the top level
                    outside any folder.: null
                  maxDepth:
                    type: integer
                    description: How deep folders can be nested.
              example:
                data:
                  - folderId: f4p9z
                    name: Product docs
                    parentId: null
                    depth: 1
                    docCount: 3
                    totalDocCount: 5
                    createdAt: '2026-10-13T09:00:00.000Z'
                    updatedAt: '2026-10-13T09:00:00.000Z'
                  - folderId: m2c7r
                    name: Pricing
                    parentId: f4p9z
                    depth: 2
                    docCount: 2
                    totalDocCount: 2
                    createdAt: '2026-10-13T09:05:00.000Z'
                    updatedAt: '2026-10-13T09:05:00.000Z'
                unfiledCount: 4
                maxDepth: 5
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    KnowledgeFolder:
      type: object
      properties:
        folderId:
          type: string
          example: f4p9z
        name:
          type: string
          example: Product docs
        parentId:
          type:
            - string
            - 'null'
        depth:
          type: integer
          description: '`1` for a top-level folder.'
        docCount:
          type: integer
          description: Knowledge bases directly in this folder.
        totalDocCount:
          type: integer
          description: Knowledge bases in this folder and its subfolders.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    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.