# Trash

The Trash module for UAPI.

## Delete item from Trash

 - [POST /Trash/remove](https://api.docs.cpanel.net/specifications/cpanel.openapi/trash/trash-remove.md): This function permanently deletes a single item from the .trash
directory in the current cPanel account's home directory.

Note:
Unlike the Fileman::fileop function with op=unlink, this function
uses a non-safe recursive delete, so it removes permission-locked
entries instead of skipping them silently and reporting them as deleted.
Such an entry might be a 0444 file or a 0555 subdirectory preserved
from a backup.

If the target is already absent, the function reports an idempotent
success rather than an error. On success, it also prunes the stale line
for the removed item, if there is one, from the trash's restore map.

## Report the disk space used by the trash directory

 - [GET /Trash/usage](https://api.docs.cpanel.net/specifications/cpanel.openapi/trash/trash-usage.md): Report the current apparent size of the trash directory's contents. Returns whether the trash exists, the total apparent bytes calculated by summing each entry's lstat size, and the number of items in the trash. Excludes the root-level .trash_restore bookkeeping file. Does not walk the account's home directory or follow symbolic links outside the trash. even on large accounts.

