Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

Learn more and register!

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 -i -X POST "" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
var requestParams = new BoxFolderRequest()
    Name = "Name in case of conflict",
    Parent = new BoxRequestEntity()
        // Folder will be placed in this parent folder if original location no longer exists
        Id = "12345" 
BoxFolder restoredFolder = await client.FoldersManager.RestoreTrashedFolderAsync(requestParams);
String folderID = "125367";
String newName = "My Documents ORIGINAL";
String newParentID = "98765";

BoxTrash trash = new BoxTrash(api);
// Avoid conflicts at the original location
trash.restoreFolder(folderID, newName, newParentID);
folder_to_restore = client.folder(folder_id='22222')
restored_folder = client.trash().restore_item(folder_to_restore)
print(f'Folder ID is {} and name is {}')
		// New name in case of conflict
		name: 'New Name',
		// Folder will be placed in this parent folder if the original parent no longer exists
		parent_id: '0'
	.then(restoredFolder => {
		/* trashedFolder -> {
			type: 'folder',
			id: '22222',
			sequence_id: '1',
			etag: '1',
			name: 'Old Files',
			created_at: '2013-05-06T22:37:30-07:00',
			modified_at: '2013-05-06T22:39:08-07:00',
			description: '',
			size: 18482,
			{ total_count: 1,
				[ { type: 'folder',
					id: '0',
					sequence_id: null,
					etag: null,
					name: 'All Files' } ] },
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: '' },
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: '' },
			trashed_at: null,
			purged_at: null,
			content_created_at: '2013-05-06T22:37:30-07:00',
			content_modified_at: '2013-05-06T22:39:08-07:00',
			{ type: 'user',
				id: '33333',
				name: 'Example User',
				login: '' },
			shared_link: null,
			folder_upload_email: null,
			{ type: 'folder',
				id: '0',
				sequence_id: null,
				etag: null,
				name: 'All Files' },
			item_status: 'active' }
TypeScript (Beta)
await client.trashedFolders.restoreFolderFromTrash(;
Python (Beta)
.NET (Beta)
await client.TrashedFolders.RestoreFolderFromTrashAsync(folderId: 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.