# Copy file/folder

Use this method to copy the file or folder.

# HTTP Request:

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

# Parameter:

Parameters Required Type Description
selected_files Yes Array Your selected file or folder name.
destination No String Destination path of file or folder.
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/copy" \
  --header 'content-type: application/json' \
  --header 'accept: application/json' \
  --header 'Authorization: <YOUR API TOKEN>' \
  --data '{
      "selected_files": ["api.php"],
      "path": "",
      "destination": "public_html"
    }'

# Response:

# File Copy:

  • 200 (Ok)
{
    "message":"Files or Directories copied successfully!"
}

# Path Error

  • 500 (Internal Server Error)
{
    "message": "You cannot copy to the same location!"
}

# 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