Skip to content
Download OpenAPI description
Overview
Languages
Servers
Mock server

https://api.docs.cpanel.net/_mock/specifications/whm.openapi/

A server running WHM.

https://{host}:{port}/json-api/

Restore Account

Account Restoration / Restore Account

Operations

Request

This function restores a user's cPanel account from a backup file.

Security
BasicAuth
Query
restore_pointstringrequired

The date of the backup to use, in YYYY-MM-DD format.

Example: restore_point=2019-10-21T00:00:00.000Z
userstringrequired

The cPanel account's username.

Example: user=username
destidstring

The destination's identification string.

  • local — The local directory.
  • The destination ID string's value.
Default "local"
Example: destid=LmTZCUpqqLSPH8AO7pVtIeNK
give_ipinteger

Whether to assign the account a dedicated IP address.

  • 1 — Assign a dedicated IP address.
  • 0 — Use the shared IP address.
Default 0
Enum01
Example: give_ip=1
mail_configinteger

Whether to restore the account's email configuration.

  • 1 — Restore.
  • 0 — Do not restore.
Default 0
Enum01
Example: mail_config=1
mysqlinteger

Whether to restore the account's MySQL® databases.

  • 1 — Restore.
  • 0 — Do not restore.
Default 0
Enum01
Example: mysql=1
subdomainsinteger

Whether to restore the account's subdomains.

  • 1 — Restore.
  • 0 — Do not restore.
Default 0
Enum01
Example: subdomains=1
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'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "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, or mysql parameters.

  • On servers with a custom Whostmgr::Transfers module, the function may not return XML output. To properly return XML output, the Whostmgr::Transfers module must allow the system to use the Cpanel::Demultiplexer module 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 TXT records instead of SPF records.

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

Security
BasicAuth
Query
typestringrequired

The type of backup to restore. The function restores the most recent backup of the type that you specify:

  • monthly
  • weekly
  • daily
Enum"monthly""weekly""daily"
Example: type=monthly
userstringrequired

The account's username.

Example: user=username
allinteger

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.
Enum01
Example: all=1
ipinteger

Whether to assign a dedicated IP address to the restored account.

  • 1 — Assign a dedicated IP address.
  • 0 — Use the shared IP address.
Enum01
Example: ip=1
mailinteger

Whether to restore account-level filters (vfilters) and forwarders (valiases).

  • 1 — Restore.
  • 0 — Do not restore.
Enum01
Example: mail=1
mysqlinteger

Whether to restore the account's MySQL® databases.

  • 1 — Restore.
  • 0 — Do not restore.
Enum01
Example: mysql=1
subsinteger

Whether to restore the account's subdomains.

  • 1 — Restore.
  • 0 — Do not restore.
Enum01
Example: subs=1
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'

Responses

HTTP Request was successful.

Bodyapplication/json
metadataobject
Response
application/json
{ "metadata": { "command": "restoreaccount", "output": {}, "reason": "OK", "result": 1, "version": 1 } }

Validate username during restoration

Request

This function checks for username conflicts during account restoration. If the function detects a username conflict, it outputs an error message in the reason return.

Security
BasicAuth
Query
userstringrequired

The cPanel account that you wish to transfer to the server.

Example: user=username
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/verify_new_username_for_restore?user=username'

Responses

HTTP Request was successful.

Bodyapplication/json
metadataobject
Response
application/json
{ "metadata": { "command": "verify_new_username_for_restore", "reason": "OK", "result": 1, "version": 1 } }

Restore Queue Management

Account Restoration / Restore Queue Management

Operations

Restore Queue Reporting

Account Restoration / Restore Queue Reporting

Operations

Account Creation

Accounts Creation / Accounts

Operations

Account Enhancements

Accounts / Account Enhancements

Operations

Account Management

Accounts / Account Management

Operations

Bandwidth and Disk Quotas

Accounts / Bandwidth and Disk Quotas

Operations

Domain Information

Accounts / Domain Domain Information

Operations
Operations

Styles

The Styles and Themes module for WHM API 1.

Operations
Operations

API Execution

API Development Tools / API Execution

Operations

API Statistics

API Development Tools / API Statistics

Operations

API Token Management

API Development Tools / API Token Management

Operations

Applications

API Development Tools / Applications

Operations

Session

API Development Tools / Session

Operations

Authentication Providers

Authentication / Authentication Providers

Operations

External Authentication

Authentication / External Authentication

Operations

Login URL

Authentication / Login URL

Operations

SSH Keys and Connections

Authentication / SSH Keys and Connections

Operations

Two-Factor Authentication

Authentication / Two-Factor Authentication

Operations

Backup Destination

Backups / Backup Destination

Operations

Backup or Restore

Backups / Backup or Restore

Operations

Backup Settings

Backups / Backup Settings

Operations

Legacy Migration

Backups / Legacy Migration

Operations

Market Integration

Commerce Integration / Market Integration

Operations

Sitejet

The Sitejet module for WHM API.

Operations

Product Management

cPanel Market / Product Management

Operations

Provider Management

cPanel Market / Provider Management

Operations

Support Access

cPanel Support Tickets / Support Access

Operations

Ticket Management

cPanel Support Tickets / Ticket Management

Operations

Customizations

The Customizations module for WHM API 1.

Operations

Manage MySQL Server

Databases / Manage MySQL Server

Operations

MySQL Databases

Databases / MySQL Databases

Operations

PostgreSQL Databases

Databases / PostgreSQL Databases

Operations

Remote MySQL Databases

Databases / Remote MySQL Databases

Operations

DNS Cluster Settings

DNS / DNS Cluster Settings

Operations
Operations
Operations

Domain Management

DNS / Domain Management

Operations

Domain Management

DNS / Domain Management

Operations
Operations

Service Records

DNS / Service Records

Operations

Feature Access

Hosting Plans / Feature Access

Operations

Feature Lists

Hosting Plans / Feature Lists

Operations

Hosting Plan Extensions

Hosting Plans / Hosting Plan Extensions

Operations

Hosting Plans

Hosting Plans / Hosting Plans

Operations

InProductSurvey

In-product survey information.

Operations

API Authentication

Integrations / API Authentication

Operations

Scripts Hooks

Integrations / Scripts Hooks

Operations

IPv4 Address Settings

IP Address Management / IPv4 Address Settings

Operations

IPv6 Address Settings

IP Address Management / IPv6 Address Settings

Operations

Network Address Translation

IP Address Management / Network Address Translation

Operations

Management

Login Security (cPHulk) / Management

Operations

Reporting

Login Security (cPHulk) / Reporting

Operations

Settings

Login Security (cPHulk) / Settings

Operations

cPanel Account Mail Management

Mail / cPanel Account Mail Management

Operations

Mail DNS Settings

Mail / Mail DNS Settings

Operations

Mail Server Settings

Mail / Mail Server Settings

Operations

Spam Management

Mail / Spam Management

Operations

Spam Protection (Greylisting)

Mail / Spam Protection (Greylisting)

Operations

NGINX Manager

The NGINX Manager module for WHM API 1.

Operations

Account Enhancement Limit

Resellers / Account Enhancement Limit

Operations

Account Limits

Resellers / Account Limits

Operations

Account Permissions

Resellers / Account Permissions

Operations

Account Settings

Resellers / Account Settings

Operations

Reseller Account Management

Resellers / Account Management

Operations
Operations

Configuration Clusters

Server Administration / Configuration Clusters

Operations

Configurations

Server Administration / Configurations

Operations

Connected Applications

Server Administration / Connected Applications

Operations

Connections

Server Administration / Connections

Operations

cPanel Analytics

The cPanel Analytics module for WHM API 1.

Operations

License Management

The Server Administration module for WHM API 1.

Operations

Notifications

Server Administration / Notifications

Operations

Plugin-Based Features

The plugin-based features module for WHM API 1.

Operations

Security

The Security module for WHM API 1.

Operations

Server Nodes

Server Administration / Server Nodes

Operations

Server Profiles

Server Administration / Server Profiles

Operations

Services

Server Administration / Services

Operations

System Information

The Server Administration module for WHM API 1.

Operations

Updates

Server Administration / Updates

Operations

Auto-Generated Certificates

SSL Certificates / Auto-Generated Certificates

Operations

cPanel Account Settings

SSL Certificates / cPanel Account Settings

Operations

SSL Server Settings

SSL Certificates / SSL Server Settings

Operations

Install or Uninstall Package

System Package Management / Install or Uninstall Package

Operations

List Package Information

System Package Management / List Package Information

Operations

Package Manager Settings

System Package Management / Package Manager Settings

Operations

cPanel Account Transfer

Transfers / cPanel Account Transfer

Operations

Transfer Configuration

Transfers / Transfer Configuration

Operations

Transfer Monitoring

Transfers / Transfer Monitoring

Operations

UserData

Scoped userdata storage functions.

Operations

EasyApache Settings

Web Server Configuration / EasyApache Settings

Operations
Operations

PHP-FPM

Web Server Configuration / PHP-FPM

Operations

Rule Settings

Web Server Security (ModSecurity) / Rule Settings

Operations

Rule Vendor Settings

Web Server Security (ModSecurity) / Rule Vendor Settings

Operations

Server Settings

Web Server Security (ModSecurity) / Server Settings

Operations