Delete a folder
/folders/{id}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
The record's id.
Responses
The folder, its subfolders and their documents were deleted.
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.
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).
The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per
problem, or a code documented on the operation.
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"