Manage Applications

    Delete a folder

    Delete a folder

    To remove a folder in Box you will need to provide our API with the ID of the folder.

    cURL
    curl -X DELETE https://api.box.com/2.0/folders/4353455 \
         -H "Authorization: Bearer <ACCESS_TOKEN>"
    .NET
    await client.FoldersManager.DeleteAsync("11111", recursive: true);
    Java
    // Delete the folder and all its contents
    BoxFolder folder = new BoxFolder(api, "id");
    folder.delete(true);
    Python
    client.folder(folder_id='22222').delete()
    Node
    client.folders.delete('12345', {recursive: true})
        .then(() => {
            // deletion succeeded — no value returned
        });

    Deleting non-empty folders

    When deleting a folder, you can pass in the recursive parameter to force a folder to be deleted even if it is not empty. This will delete all items within this folder, including any of their descendants.