Trash

Delete item from Trash

Changed on

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.

post/Trash/remove

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Query parameters

pathstring required
Example:/.trash/backup-7.14.2026_16-35-25

The path of the item to permanently delete.

Note: This parameter must resolve strictly within the .trash directory in the account's home directory. A leading slash is read relative to the home directory, so /.trash/backup-7.14.2026_16-35-25 is the expected form. The function resolves symlinks and .. traversal before it runs that confinement check, and the trash directory itself can never be the target.

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": "remove",
  "module": "Trash",
  "result": {
    "data": {
      "removed": true
    },
    "status": 1
  }
}

Changes

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • warning

      added the new 0.00 enum value to the / response property for the response status

    • warning

      added the new 1.00 enum value to the / response property for the response status

    • info

      api operation id remove removed and replaced with Trash-remove

    • info

      added the optional property / to the response with the status