Permanently Delete File
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 -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
});