Box Developer Documentation

A beta version of the new Box developer documentation site is launching soon! Updated Developer Guides, modern API Reference, and AI-powered search are on the way to help you build with Box faster. Stay tuned for more updates.

Restore Folder

Restore Folder

To restore a folder that has been moved to the trash, but has not yet been purged, make a POST request to the /folders/:folder_id endpoint. This will place the folder in the original parent folder if it is still available, or you optionally can specify a parent folder.

cURL
curl -i -X POST "https://api.box.com/2.0/folders/4353455" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.trashedFolders.restoreFolderFromTrash(folder.id);
Python v10
client.trashed_folders.restore_folder_from_trash(folder.id)
.NET v10
await client.TrashedFolders.RestoreFolderFromTrashAsync(folderId: folder.Id);
Swift v10
try await client.trashedFolders.restoreFolderFromTrash(folderId: folder.id)
Java v10
client.getTrashedFolders().restoreFolderFromTrash(folder.getId())
.NET v6
await client.TrashedFolders.RestoreFolderFromTrashAsync(folderId: folder.Id);
Node v4
await client.trashedFolders.restoreFolderFromTrash(folder.id);

During a folder restoration operation, part of the file tree will be locked, such as the source folder for the request and all of its descendants, as well as the destination folder.

During the restoration of the folder, no other move, copy, delete, or restore operation can be performed on the locked folders.