Delete a folder
POST/api/v1/storage/delete-folder
Deletes the selected folder entry and reports deletion counts on success.
With recursive false or omitted, the operation leaves descendants in place and does not require an empty folder. This option cannot safely test whether the project still contains documents.
With recursive: true, it also attempts descendant file and folder deletion. A failure can follow earlier object deletions, so inspect the resulting state before recovery.
The following access conditions are preserved as declared intent and are not implemented by generated code: Accepted storage owner context, Storage owner actor routing.
Use this in a guide: Organize a customer’s project documents
Request
Responses
- 200
Folder deleted
Delete the selected empty folder; recursive deletion is not requested.
Section ID: DOC-CP-files-data-api-deleteFolder#example-storage-deleteFolder-request
Request example
{
"folderPath": "reports",
"recursive": false
}
Guide request for Remove the project’s documents when the customer chooses. Replace example resource identifiers with your own authorized values.
Section ID: DOC-CP-files-data-api-deleteFolder#example-cookbook-core-platform-files-data-folders-02-request
Request example
{
"folderPath": "/documents/work",
"recursive": true
}
Illustrative response shape; omitted default fields and actual outcomes depend on the operation.
Section ID: DOC-CP-files-data-api-deleteFolder#example-storage-deleteFolder-response
Response example
{
"deleted": true,
"filesDeleted": 1,
"foldersDeleted": 1
}
Document ID: DOC-CP-files-data-api-deleteFolder. Section identities and revisions.
| Section | Stable reference |
|---|---|
| Delete a folder | DOC-CP-files-data-api-deleteFolder#overview |
| Request | DOC-CP-files-data-api-deleteFolder#request |
| Responses | DOC-CP-files-data-api-deleteFolder#responses |