UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function lists all of an item's backup locations. An item can be a file, a directory, or a symlink.
Important:
When you disable the File Storage role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Restore/query_file_info
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Restore/query_file_info
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Restore/query_file_info?path=%2Fpublic_html%2Findex.php&exists=0'{ "apiversion": 3, "func": "query_file_info", "module": "Restore", "result": { "data": [ … ], "errors": null, "messages": null, "metadata": { … }, "status": 1, "warnings": null } }
Request
This function restores a file or directory from a backup to the file or directory's original location.
Important:
When you disable the File Storage role, the system disables this function.
The backup's identification.
YYYY-MM-DD— Restore a daily backup from the specified backup date.incremental— Restore a daily incremental backup.weekly/YYYY-MM-DD— Restore a weekly backup from the specified backup date.monthly/YYYY-MM-DD— Restore a monthly backup from the specified backup date.weekly/incremental— Restore a weekly incremental backup.monthly/incremental— Restore a monthly incremental backup.
A daily backup file from a specified backup date.
A daily backup file from a specified backup date.
Whether to overwrite the file or directory on the disc with its backup replacement.
1— Overwrite the file or directory.0— Do not overwrite the file or directory.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Restore/restore_file
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Restore/restore_file
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Restore/restore_file?backupID=weekly%2F2017-07-03&overwrite=1&path=%2Fpublic_html%2Findex.php'{ "apiversion": 3, "func": "restore_file", "module": "Restore", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }