Skip to main content

Unlink a folder's subtree before deleting it.

POST/api/v1/folders/{folder_id}/prune-subtreefolders:delete

Documents filed in the folder or its subfolders and also in a folder outside are unlinked from the subtree and stay (unlinked_document_ids). Documents filed only inside keep their filing and are returned (exclusive_document_ids) to delete with batch_delete_documents. folder_ids lists the folder and every folder under it, deepest first, to delete with delete_folder once empty. Needs Delete Folders and sight of every folder in the subtree (409 otherwise). Documents you cannot read are counted, not named.

Scopefolders:delete
AsynchronousNo
MCP toolprune_folder_subtree
Portal permissionsdelete_folders

Parameters​

NameInTypeRequiredDescription
folder_idpathstringRequired
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Responses​

StatusDescriptionBody
200Success.application/json FolderPruneResult
400invalid_versionapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
404not_foundapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409conflict, idempotency_in_progressapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

FolderPruneResult​

FieldTypeRequiredDescription
exclusive_document_idsarray of stringRequiredDocuments readable by you that are filed only inside the subtree, still filed there: delete them, then the folders.
folder_idsarray of stringRequiredThe folder and every folder under it, deepest first.
hidden_documentsintegerRequiredDocuments of the subtree you cannot read, filed only inside it or unlinked: counted, not named. ≥ -2147483648; ≤ 2147483647
removed_filingsintegerRequiredHow many filings (document in folder) were removed, documents you cannot read included. ≥ -2147483648; ≤ 2147483647
unlinked_document_idsarray of stringRequiredDocuments readable by you that are also filed outside the subtree and were unlinked from it.