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

# List Folders

> List [knowledge base](/line/knowledge-base) folders



## OpenAPI

````yaml /latest.yml GET /agents/folders
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /agents/folders:
    get:
      tags:
        - Folders
      summary: List Folders
      description: List [knowledge base](/line/knowledge-base) folders
      operationId: folders_list
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
        - name: parent_ids[]
          in: query
          description: >-
            Filter to folders with these parent IDs. Repeat the parameter to
            pass multiple values (e.g.,
            `?parent_ids[]=folder_abc&parent_ids[]=null`). Pass the literal
            string `null` to include top-level folders. Defaults to `[null]`
            (top-level folders only).
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
        - name: depth
          in: query
          description: >-
            How many levels of nested children to include in the response,
            between 1 and 3. Defaults to 3.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 3
            default: 3
        - name: starting_after
          in: query
          description: >-
            A cursor for pagination. Pass the ID of the last folder from the
            previous page to fetch the next page.
          required: false
          schema:
            type: string
        - name: ending_before
          in: query
          description: >-
            A cursor for pagination. Pass the ID of the first folder from the
            previous page to fetch the previous page.
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            The number of folders to return per page, ranging between 1 and 100.
            Defaults to 10. Pagination applies to the top-level folders in the
            response; nested children do not count against this limit.
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
      responses:
        '200':
          description: A paginated tree of folders.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListFoldersResponse'
      security:
        - APIKeyAuth: []
components:
  parameters:
    CartesiaVersionHeader:
      name: Cartesia-Version
      in: header
      description: API version header.
      required: true
      schema:
        type: string
        format: date
        example: '2026-03-01'
        enum:
          - '2026-03-01'
  schemas:
    ListFoldersResponse:
      title: ListFoldersResponse
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/FolderTreeResponse'
          description: The paginated list of top-level folders matching the request.
        has_more:
          type: boolean
          description: Whether more results are available after this page.
        next_page:
          type: string
          nullable: true
          description: >-
            An ID that can be passed as `starting_after` or `ending_before` to
            get the next page.
      required:
        - data
        - has_more
    FolderTreeResponse:
      title: FolderTreeResponse
      description: A folder with its nested subfolders.
      allOf:
        - $ref: '#/components/schemas/FolderResponse'
        - type: object
          properties:
            children:
              type: array
              items:
                $ref: '#/components/schemas/FolderResponse'
              description: >-
                Nested subfolders, up to the requested `depth`. Each child has
                the same shape as this object, including its own `children`.
          required:
            - children
    FolderResponse:
      title: FolderResponse
      type: object
      properties:
        id:
          type: string
          description: The ID of the folder.
        parent_id:
          type: string
          nullable: true
          description: The ID of the parent folder, or `null` for top-level folders.
        name:
          type: string
          description: The folder's name.
        created_at:
          type: string
          format: date-time
          description: When the folder was created.
        agents:
          type: array
          items:
            $ref: '#/components/schemas/FolderAgentSummary'
          description: Agents that have access to this folder.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/FolderDocumentSummary'
          description: Documents inside this folder.
      required:
        - id
        - parent_id
        - name
        - created_at
        - agents
        - documents
    FolderAgentSummary:
      title: FolderAgentSummary
      type: object
      description: An agent that has access to this folder.
      properties:
        id:
          type: string
          description: The ID of the agent.
        name:
          type: string
          description: The name of the agent.
      required:
        - id
        - name
    FolderDocumentSummary:
      title: FolderDocumentSummary
      type: object
      description: >-
        A document summary as returned inside a folder. Does not include the
        document `content`.
      properties:
        id:
          type: string
          description: The ID of the document.
        name:
          type: string
          nullable: true
          description: The document's display name, or `null` if unnamed.
        created_at:
          type: string
          format: date-time
          description: When the document was uploaded.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: User-defined string-keyed metadata.
      required:
        - id
        - name
        - created_at
        - metadata
  securitySchemes:
    APIKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Cartesia API key (`sk_car_...`). Get one at
        [play.cartesia.ai/keys](https://play.cartesia.ai/keys).

````