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

Learn more and register!

Permanently Delete File

Guides Trash Permanently Delete File
Edit this page

Permanently Delete File

Once a file has been moved to the trash, it will stay in the trash for 30 days by default before being purged. Administrators of Business or Enterprise accounts can alter the purge window. If you wish to permanently delete the file from the trash before the purge window expires, make a DELETE request to /files/:file_id/trash using the trashed file's ID.

cURL
curl -i -X DELETE "https://api.box.com/2.0/files/12345/trash" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
.NET
await client.FilesManager.PurgeTrashedAsync("11111");
Java
String fileID = "87398";
BoxTrash trash = new BoxTrash(api);
trash.deleteFile(fileID);
Python
file_to_delete = client.file(file_id='11111')
client.trash().permanently_delete_item(file_to_delete)
print('The file was deleted from trash!')
Node
client.files.deletePermanently('11111')
	.then(() => {
		// deletion succeeded — no value returned
	});
TypeScript (Beta)
await client.trashedFiles.deleteTrashedFileById(file.id);
Python (Beta)
client.trashed_files.delete_trashed_file_by_id(file.id)
.NET (Beta)
await client.TrashedFiles.DeleteTrashedFileByIdAsync(fileId: file.Id);