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

# Delete Folder

> Delete a folder. With recursive=false, non-empty folders return 409 and no contents are deleted.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/profound/openapi.documented.yml delete /v1/knowledge-bases/{knowledge_base_id}/folders
openapi: 3.1.0
info:
  title: External API
  version: 8a280fe080bc62612cfa4d9ac5672343e0a2f720
servers:
  - url: https://api.tryprofound.com
    description: Production Server
security: []
paths:
  /v1/knowledge-bases/{knowledge_base_id}/folders:
    delete:
      tags:
        - Knowledge bases
      summary: Delete Folder
      description: >-
        Delete a folder. With recursive=false, non-empty folders return 409 and
        no contents are deleted.
      operationId: delete_folder_v1_knowledge_bases__knowledge_base_id__folders_delete
      parameters:
        - name: knowledge_base_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Unique knowledge base ID.
            title: Knowledge Base Id
          description: Unique knowledge base ID.
        - name: organization_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: >-
              Organization scope for API keys that can access multiple
              organizations.
            title: Organization Id
          description: >-
            Organization scope for API keys that can access multiple
            organizations.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteFolderRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderOperationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Profound from '@profoundai/client';


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


            const folder = await
            client.knowledgeBases.folders.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            {
              path: 'x',
            });


            console.log(folder.message);
        - lang: Python
          source: |-
            import os
            from profound import Profound

            client = Profound(
                api_key=os.environ.get("PROFOUND_API_KEY"),  # This is the default and can be omitted
            )
            folder = client.knowledge_bases.folders.delete(
                knowledge_base_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                path="x",
            )
            print(folder.message)
components:
  schemas:
    DeleteFolderRequest:
      properties:
        path:
          type: string
          minLength: 1
          title: Path
          description: Folder path to delete.
        recursive:
          type: boolean
          title: Recursive
          description: >-
            When false, only empty folders are deleted and non-empty folders
            return a conflict. When true, the folder and all contents are
            deleted.
          default: false
      additionalProperties: false
      type: object
      required:
        - path
      title: DeleteFolderRequest
    FolderOperationResponse:
      properties:
        message:
          type: string
          title: Message
          description: Operation result message.
        path:
          type: string
          title: Path
          description: Folder path.
      additionalProperties: false
      type: object
      required:
        - message
        - path
      title: FolderOperationResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````