v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Fileman
Manage Files

Move a file to the trash

This function moves a file or directory to the account trash directory and records its original path so that you can restore it later with the restore_from_trash function.

Important:

When you disable the File Storage role, the system disables this function.

get/Fileman/trash_file

Query parameters

pathstring path required
Example:public_html/unwanted.txt

The path to the file or directory to move to the trash.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "trash_file",
  "module": "Fileman",
  "result": {
    "data": {
      "trash_leaf": "unwanted.txt"
    },
    "status": 1
  }
}