Folders

Delete a folder

DELETE/folders/{id}
documents:writedelete_folderDestructiveIdempotent

Deletes the folder, its subfolders and their documents with one timestamp, and returns 204. A deal's root, a user's Other root and a user's portfolio documents root return 409 invalid_state; a folder whose subtree holds a deal or team member image returns 409 conflict. An already deleted folder returns 404. The old route refused non-empty folders with 422 folder_not_empty. No dry run. Emits folder.deleted after commit; no email. POST /folders/{id}/actions/restore undoes it.

Path parameters

  • idstring (uuid)Required#

    The record's id.

Responses

204

The folder, its subfolders and their documents were deleted.

401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is forbidden when the token's user can't write the folder: any folder in the tree of a deal the token can see is writable, otherwise the folder's write list, write flags or super admin are needed. This is deliberately broader than the platform (no editor-role check) and stricter (the check applies where the platform skips it by role). Other codes are missing_scope, scope_disabled, org_disabled, ip_blocked, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
409

The request conflicts with the folder's state. error.code is folder_name_taken (a live sibling has the name), folder_locked (the folder or its parent is locked), folder_cycle (a move into itself or a subfolder), folder_deleted (the parent is deleted) invalid_state (a root folder, which can't be deleted or restored) or conflict (on delete: the folder or a subfolder holds a file a deal or team member uses as an image).

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X DELETE https://your-org-domain/kong/core/api/v2/folders/{id}\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"