v1

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

Restore a file from the trash

This function restores a previously trashed file or directory to its original location. Pass the item's original path. If the path was trashed more than once, the function restores the most recent copy. The function returns an error if the original path already exists.

Important:

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

get/Fileman/restore_from_trash

Query parameters

pathstring path required
Example:public_html/unwanted.txt

The original path of the trashed file or directory.

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": "restore_from_trash",
  "module": "Fileman",
  "result": {
    "data": {
      "trash_leaf": "unwanted.txt"
    },
    "status": 1
  }
}