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

# Delete Folder

> Delete a [knowledge base](/line/knowledge-base) folder



## OpenAPI

````yaml /latest.yml DELETE /agents/folders/{id}
openapi: 3.0.1
info:
  title: Cartesia API
  version: 0.0.1
servers:
  - url: https://api.cartesia.ai
    description: Production
security: []
paths:
  /agents/folders/{id}:
    delete:
      tags:
        - Folders
      summary: Delete Folder
      description: Delete a [knowledge base](/line/knowledge-base) folder
      operationId: folders_delete
      parameters:
        - $ref: '#/components/parameters/CartesiaVersionHeader'
        - name: id
          in: path
          description: >-
            The ID of the folder.

            The folder must be empty of child folders; delete or move
            sub-folders first. Documents inside the folder are deleted with it.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Folder deleted.
        '400':
          description: >-
            The folder has child folders that must be deleted or moved first
            (`error_code: kb_folder_has_children`), or this is the last
            remaining folder in the organization (`error_code: kb_folder_last`).
        '404':
          description: 'Folder not found (`error_code: kb_folder_not_found`).'
      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'
  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).

````