v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
File Restoration

Restore files

This function restores an account's files.

Important:

When the File Storage role is disabled, the system also disables this function.

Note:

You must use the backup parameter when you call this function in one of the following formats:

  • As part of a multipart/form-data request body to upload and restore a backup file to the server. For more information about this structure, read Mozilla's POST Method documentation.
  • As a query parameter to restore an existing file on the server.
post/Backup/restore_files

Query parameters

backupstring

The backup file to restore.

Important:

Only pass this parameter to restore backup files that already exist on the server.

Note:

To restore multiple backup files, increment the parameter name. For example: backup-1backup-2, and backup-3.

directorystring path
Example:/home/user/example

The directory to which to restore the file. The default is the user's home directory.

timeoutinteger
Example:7200

The maximum number of seconds to try to restore the file.

  • 0 - The system will not time out the file restoration.
verbose0 | 1
Example:1

Whether to return additional information from the /home/cptest/.cpanel/logs/restorefiles log files.

  • 1 - Return additional information.
  • 0 - Do not return additional information.

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": "restore_files",
  "module": "Backup",
  "result": {
    "data": {
      "log_id": "2019-08-13T15:10:07Z.1",
      "log_path": "/home/cptest/.cpanel/logs/restorefiles/2019-08-13T15:10:07Z.1.log",
      "messages": [
        "The system successfully restored the directory /home/cpuser/point2 from the backup file backup-cpuser.tld-9-10-2019_1.tar.gz"
      ]
    },
    "status": 1
  }
}