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: <api-key>' \
  --data '
{
  "entities": [
    {
      "id": 123
    }
  ],
  "cascade": false,
  "workspace_id": 123
}
'
{
  "moved_count": 123
}

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.

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.

Authorizations

X-API-KEY
string
header
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.