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

# Delete Folder Entities

Deletes one or more entities from the workspace. Supports deleting folders, prompts, snippets, workflows, datasets, evaluations, AB tests, and input variable sets. Use `cascade=true` to recursively delete all contents of a folder. Without cascade, deleting a non-empty folder returns an error. Entities are soft-deleted where applicable.


## OpenAPI

````yaml DELETE /api/public/v2/folders/entities
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/public/v2/folders/entities:
    delete:
      tags:
        - folders
      summary: Delete Folder Entities
      operationId: delete_folder_entities_api_public_v2_folders_entities_delete
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteFolderEntitiesRequest'
      responses:
        '200':
          description: Entities deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FolderEntitiesCountResponse'
        '400':
          description: >-
            Bad request - Folder is not empty (use cascade=true) or invalid
            entity type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Entity not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
        '500':
          description: Internal server error during deletion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    DeleteFolderEntitiesRequest:
      type: object
      required:
        - entities
      properties:
        entities:
          type: array
          items:
            $ref: '#/components/schemas/EntityReference'
          description: List of entities to delete.
        cascade:
          type: boolean
          default: false
          description: >-
            When true, recursively deletes all contents of any folders in the
            entities list. When false, attempting to delete a non-empty folder
            returns an error.
        workspace_id:
          type: integer
          description: The ID of the workspace.
      title: DeleteFolderEntitiesRequest
    FolderEntitiesCountResponse:
      type: object
      properties:
        moved_count:
          type: integer
          description: The number of entities affected by the operation.
      title: FolderEntitiesCountResponse
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          default: false
          description: Indicates that the request failed.
        message:
          type: string
          description: Human-readable error message.
        error:
          type: string
          description: Machine-readable or fallback error message.
      additionalProperties: true
      description: >-
        Standard error response. Some legacy endpoints may return either message
        or error.
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      title: UnauthorizedError
    EntityReference:
      type: object
      required:
        - id
        - type
      properties:
        id:
          type: integer
          exclusiveMinimum: 0
          description: The ID of the entity.
        type:
          $ref: '#/components/schemas/EntityType'
      title: EntityReference
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EntityType:
      type: string
      enum:
        - FOLDER
        - PROMPT
        - SNIPPET
        - WORKFLOW
        - DATASET
        - REPORT
        - AB_TEST
        - INPUT_VARIABLE_SET
      description: >-
        The type of entity. SNIPPET is a pseudo-entity type representing
        completion-type prompts.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  responses:
    ValidationError:
      description: Validation error - request parameters or body are invalid.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/HTTPValidationError'
              - $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````