WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
The date of the backup to use, in YYYY-MM-DD format.
The destination's identification string.
local— The local directory.- The destination ID string's value.
Whether to assign the account a dedicated IP address.
1— Assign a dedicated IP address.0— Use the shared IP address.
Whether to restore the account's email configuration.
1— Restore.0— Do not restore.
Whether to restore the account's MySQL® databases.
1— Restore.0— Do not restore.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restore_queue_add_task
- A server running WHM.
https://whm-server.tld:2087/json-api/restore_queue_add_task
- 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/whm.openapi/restore_queue_add_task?restore_point=2019-10-21T00%3A00%3A00.000Z&user=username&destid=LmTZCUpqqLSPH8AO7pVtIeNK&give_ip=1&mail_config=1&mysql=1&subdomains=1'{ "data": { "queue_id": "3b99QG5fp99tdL5" }, "metadata": { "command": "restore_queue_add_task", "reason": "OK", "result": 1, "version": 1 } }
Request
This function restores an account backup. You can use this function to restore daily, weekly, or monthly backups.
Important:
When you call this function, you must include at least one of the
all,mail,subs, ormysqlparameters.On servers with a custom
Whostmgr::Transfersmodule, the function may not return XML output. To properly return XML output, theWhostmgr::Transfersmodule must allow the system to use theCpanel::Demultiplexermodule to capture output.
Note:
On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.
This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use
TXTrecords instead ofSPFrecords.Red Hat 7.1 and CentOS 7.1 both contain
bind-9.9.4-23.el7, which is an updated version of BIND that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of BIND. For more information, read the Red Hat Bugzilla case about SPF record errors.
The type of backup to restore. The function restores the most recent backup of the type that you specify:
monthlyweeklydaily
Whether to create the account before restoration.
1— Create and then restore the account. If you select this value and the account already exists, the function will fail.0— Restore only.
Whether to assign a dedicated IP address to the restored account.
1— Assign a dedicated IP address.0— Use the shared IP address.
Whether to restore account-level filters (vfilters) and forwarders (valiases).
1— Restore.0— Do not restore.
Whether to restore the account's MySQL® databases.
1— Restore.0— Do not restore.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/restoreaccount
- A server running WHM.
https://whm-server.tld:2087/json-api/restoreaccount
- 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/whm.openapi/restoreaccount?type=monthly&user=username&all=1&ip=1&mail=1&mysql=1&subs=1'{ "metadata": { "command": "restoreaccount", "output": { … }, "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/verify_new_username_for_restore
- A server running WHM.
https://whm-server.tld:2087/json-api/verify_new_username_for_restore
- 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/whm.openapi/verify_new_username_for_restore?user=username'{ "metadata": { "command": "verify_new_username_for_restore", "reason": "OK", "result": 1, "version": 1 } }