Delete folder


Deletes a folder, either permanently or by moving it to the trash.



Path Parameters

stringin pathrequired

The unique identifier that represent a folder.

The ID for any folder can be determined by visiting this folder in the web application and copying the ID from the URL. For example, for the URL https://* the folder_id is 123.

The root folder of a Box account is always represented by the ID 0.

Query Parameters

booleanin queryoptional

Delete a folder that is not empty by recursively deleting the folder and all of its content.

Request Headers

stringin headeroptional

Ensures this item hasn't recently changed before making changes.

Pass in the item's last observed etag value into this header and the endpoint will fail with a 412 Precondition Failed if it has changed since.



Returns an empty response when the folder is successfully deleted or moved to the trash.

application/jsonClient error

Returns an error if the user makes a bad request.

  • folder_not_empty: Returned if the folder is not empty. Use the recursive query parameter to recursively delete the folder and its contents.
application/jsonClient error

Returns an error if the user does not have the required access to perform the action.

  • access_denied_insufficient_permissions: Returned when the user does not have access to the folder, or when a folder lock has been applied to the folder to prevent deletion.

  • insufficient_scope: Returned an error if the application does not have the right scope to delete folders. Make sure your application has been configured to read and write all files and folders stored in Box.

application/jsonClient error

Returns an error if the folder could not be found, or the authenticated user does not have access to the folder.

  • not_found when the authenticated user does not have access to the folder.
application/jsonClient error
  • operation_blocked_temporary: Returned if the folder is locked due to another move, copy, delete or restore operation in progress.

    The operation can be retried at a later point.

application/jsonClient error

Returns an error when the If-Match header does not match the current etag value of the folder. This indicates that the folder has changed since it was last requested.

application/jsonClient error

Returns an error when the operation takes longer than 60 seconds. The operation will continue after this response has been returned.

application/jsonClient error

An unexpected client error.

Delete folder
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

curl -i -X DELETE "" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
await client.FoldersManager.DeleteAsync("11111", recursive: true);
// Delete the folder and all its contents
BoxFolder folder = new BoxFolder(api, "id");
client.folders.delete('12345', {recursive: true})
    .then(() => {
        // deletion succeeded — no value returned
client.folders.delete(folderId: "22222", recursive: true) { result: Result<Void, BoxSDKError>} in
    guard case .success = result else {
        print("Error deleting folder")

    print("Folder and contents successfully deleted")
TypeScript Gen
await parentClient.folders.deleteFolderById(;
Python Gen
.NET (Beta)
await parentClient.Folders.DeleteFolderByIdAsync(folderId: folder.Id);