Box Developer Documentation
Latest version

Permanently remove file

delete
https://api.box.com/2.0
/files/:file_id/trash

This endpoint is in the version 2024.0. No changes are required to continue using it. For more details, see Box API versioning.

Permanently deletes a file that is in the trash. This action cannot be undone.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The unique identifier that represents a file.

The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/files/123 the file_id is 123.

Response

none

Returns an empty response when the file was permanently deleted.

application/jsonClient error

Returns an error if the file is not in the trash.

application/jsonClient error

An unexpected client error.

delete
Permanently remove file
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

Learn more about Box SDK versionig strategy.


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