Skip to main content
DELETE
/
api
/
public
/
v2
/
folders
/
entities
Delete Folder Entities
curl --request DELETE \
  --url https://api.promptlayer.com/api/public/v2/folders/entities \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '
{
  "entities": [
    {
      "id": 123,
      "type": "FOLDER"
    }
  ],
  "cascade": false,
  "workspace_id": 123
}
'
{
  "moved_count": 123
}
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.

Headers

X-API-KEY
string
required

Body

application/json
entities
EntityReference · object[]
required

List of entities to delete.

cascade
boolean
default:false

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
integer

The ID of the workspace.

Response

Entities deleted successfully

moved_count
integer

The number of entities affected by the operation.