# 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.

Endpoint: POST /Backup/restore_files
Version: 11.136.0.4
Security: BasicAuth

## Query parameters:

  - `backup` (string)
    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-1, backup-2, and backup-3.

  - `directory` (string)
    The directory to which to restore the file. The default is the user's home directory.
    Example: "/home/user/example"

  - `timeout` (integer)
    The maximum number of seconds to try to restore the file.
* 0 - The system will not time out the file restoration.
    Example: 7200

  - `verbose` (integer)
    Whether to return additional information from the /home/cptest/.cpanel/logs/restorefiles log files.
* 1 - Return additional information.
* 0 - Do not return additional information.
    Enum: 0, 1

## Request fields (multipart/form-data):

  - `backup` (string)

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "restore_files"

  - `module` (string)
    The name of the module called.
    Example: "Backup"

  - `result` (object)

  - `result.data` (object)

  - `result.data.log_id` (string)
    The log file's restoration identification (ID). The system uses the backup restoration's date to create this ID. The ID is in [ISO-8601 Date Time](https://en.wikipedia.org/wiki/ISO_8601) format with the log's revision number appended.
    Example: "2019-08-13T15:10:07Z.1"

  - `result.data.log_path` (string)
    The filepath to the backup restoration's log file.
    Example: "/home/cptest/.cpanel/logs/restorefiles/2019-08-13T15:10:07Z.1.log"

  - `result.data.messages` (array)
    An array of statements about the database's restoration.
    Example: ["The system successfully restored the directory /home/cpuser/point2 from the backup file backup-cpuser.tld-9-10-2019_1.tar.gz"]

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.status` (integer)
    * 1 - Success
* 0 - Failed: Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


