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 File

Restore File

To restore a file that has been moved to the trash, but has not yet been purged, make a POST request to the /files/:file_id endpoint. This will place the file in the original 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/files/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.trashedFiles.restoreFileFromTrash(file.id);
Python v10
client.trashed_files.restore_file_from_trash(file.id)
.NET v10
await client.TrashedFiles.RestoreFileFromTrashAsync(fileId: file.Id);
Swift v10
try await client.trashedFiles.restoreFileFromTrash(fileId: file.id)
Java v10
client.getTrashedFiles().restoreFileFromTrash(file.getId())
.NET v6
await client.TrashedFiles.RestoreFileFromTrashAsync(fileId: file.Id);
Node v4
await client.trashedFiles.restoreFileFromTrash(file.id);