v1

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

Rename a file

This function changes the name of a file or directory within the same directory. To move a file to a different directory, use the move_file function. The function returns an error if the destination already exists.

Important:

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

get/Fileman/rename_file

Query parameters

destinationstring path required
Example:public_html/new.txt

The new path, in the same directory as the source.

sourcestring path required
Example:public_html/old.txt

The path to the file or directory to rename.

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": "rename_file",
  "module": "Fileman",
  "result": {
    "status": 1
  }
}