Delete item from Trash
Changed onThis 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.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Query parameters
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.
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.00enum value to the/response property for the response status - warning
added the new
1.00enum value to the/response property for the response status - info
api operation id
removeremoved and replaced withTrash-remove - info
added the optional property
/to the response with the status
- breaking