# Rename

Use this method to rename the File or folder.

# HTTP Request:

PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/file-managers/file/rename

# Parameter:

Parameters Required Type Description
file_name Yes String Your old file name.
file_rename Yes String Your new file name.
path No String A path of file or folder.

# Curl Request example:

curl --request PATCH \
  --url "https://api.serveravatar.com/organizations/5/servers/15/applications/92/file-managers/file/rename" \
  --header 'content-type: application/json' \
  --header 'accept: application/json' \
  --header 'Authorization: <YOUR API TOKEN>' \
  --data '{
    "file_name": "api.php",
    "file_rename": "test.php",
    "path": "public_html"
    }'

# Response:

# File Rename:

  • 200 (Ok)
{
    "message":"Rename successfully."
}

# Organization Not Found

  • 404 (Not Found)
{
    "message": "Organization not found!"
}

# Server Not Found

  • 404 (Not Found)
{
    "message": "Server not found!"
}

# Application Not Found

  • 404 (Not Found)
{
    "message": "Application not found!"
}

# Server Error

  • 500 (Internal Server Error)
{
    "message": "Something went really wrong!"
}
Last Updated: 3/1/2023, 2:00:48 PM