to navigate to open Esc to close Search by Algolia

API: Managing the trash

Available since FileRun 2026.3.0.

Target URL (restore) /api.php/Drive/files/trash/item/restore
Target URL (delete permanently) /api.php/Drive/files/trash/item/delete
Target URL (empty) /api.php/Drive/files/trash/empty
Required scope delete
HTTP Method POST
Output format JSON

The trash is covered by the account permission to rename, move and delete files and folders.

Trash item paths

An item in the trash is identified by the id of its trash record, in a path of the form /ROOT/TRASH/1234. The trash keeps the original name of an item, so several trashed items can share the same name. Only the record id tells them apart. There are two ways to obtain the path of a trashed item:

The endpoints refuse a path which names no trash record ("Trash item not found!"), a path outside the trash ("The item is not inside the trash folder!") and a trash record of another account ("Trash item belongs to another user!").

Restoring an item

Parameter Type Required Description
path string Yes The trash path of the item, see above.

The item is moved back to the folder it was deleted from, together with its contents when it is a folder. If that folder no longer exists, the item is placed in the home folder of the account. The response carries the FileRun path the item was restored to as restored_path.

If the original name is taken by another item in the meantime, the restoration is refused and the item stays in the trash.

Deleting an item permanently

Parameter Type Required Description
path string Yes The trash path of the item, see above.

The item is removed for good, together with its contents when it is a folder. There is no way back afterwards.

Emptying the trash

This endpoint takes no parameters. Every item in the trash of the account is removed for good. The response carries the number of removed items as deleted_count.