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

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

Return backup configuration file data

Request

This function retrieves your backup destination configuration file data.

Security
BasicAuth
curl -i -X GET \
  -u <username>:<password> \
  https://api.docs.cpanel.net/_mock/specifications/whm.openapi/backup_config_get

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "backup_config": {} }, "metadata": { "command": "backup_config_get", "reason": "OK", "result": 1, "version": 1 } }

Update the system's backup configuration

Request

This function configures a server's backup system. The system saves these settings in the /var/cpanel/backups/config file.

Security
BasicAuth
Query
backup_daily_enableinteger

Whether to enable daily backups.

  • 1 — Enable.
  • 0 — Disable.
Default 1
Enum01
Example: backup_daily_enable=1
backup_daily_retentioninteger>= 0

The number of daily backups to retain.

Default 5
Example: backup_daily_retention=5
backup_monthly_datesinteger[ 1 .. 31 ]

Which days of the month to run backups.

Note:

To add multiple days, use a comma-delimited list.

Default 1
Example: backup_monthly_dates=1
backup_monthly_enableinteger

Whether to enable monthly backups.

  • 1 — Enable.
  • 0 — Disable.
Default 0
Enum01
Example: backup_monthly_enable=0
backup_monthly_retentioninteger>= 0

The number of monthly backups to retain.

Default 1
Example: backup_monthly_retention=5
backup_weekly_dayinteger[ 1 .. 6 ]

Which day of the week to run weekly backups.

  • 0 — Sunday.
  • 1 — Monday.
  • 2 — Tuesday.
  • 3 — Wednesday.
  • 4 — Thursday.
  • 5 — Friday.
  • 6 — Saturday.
Default 0
Example: backup_weekly_day=1
backup_weekly_enableinteger

Whether to enable weekly backups.

  • 1 — Enable.
  • 0 — Disable.
Default 0
Enum01
Example: backup_weekly_enable=0
backup_weekly_retentioninteger>= 0

The number of weekly backups to retain.

Default 4
Example: backup_weekly_retention=4
backupacctsinteger

Whether to back up cPanel user accounts.

  • 1 — Back up.
  • 0 — Do not back up.

Note:

This setting affects whether the system enables the File and Directory Restoration interfaces in cPanel and in WHM. For more information, read the How to Manage Metadata Settings documentation.

Default 1
Enum01
Example: backupaccts=1
backupbwdatainteger

Whether to back up bandwidth tracking data.

  • 1 — Back up.
  • 0 — Do not back up.
Default 1
Enum01
Example: backupbwdata=1
backupdaysstring[ 0 .. 6 ]

Which days of the week to run daily backups.

  • 0 — Sunday.
  • 1 — Monday.
  • 2 — Tuesday.
  • 3 — Wednesday.
  • 4 — Thursday.
  • 5 — Friday.
  • 6 — Saturday.

Note:

For multiple days, use a comma-delimited list.

Default "0,2,4,6"
Example: backupdays=0,1,2,3,4,5,6
backupdirstring

The primary backup directory.

Default "/backup"
Example: backupdir=/backup
backupenableinteger

Whether to enable backups.

  • 1 — Enable.
  • 0 — Disable.

Note:

This setting affects whether the system enables the File and Directory Restoration interfaces in cPanel and in WHM. For more information, read the How to Manage Metadata Settings documentation.

Default 0
Enum01
Example: backupenable=0
backupfilesinteger

Whether to back up system files.

  • 1 — Back up.
  • 0 — Do not back up.
Default 1
Enum01
Example: backupfiles=1
backuplogsinteger

Whether to back up the error logs.

  • 1 — Back up.
  • 0 — Do not back up.
Default 0
Enum01
Example: backuplogs=0
backupmountinteger

Whether to mount a backup partition.

  • 1 — Mount.
  • 0 — Do not mount.

Note:

This setting affects whether the system enables the File and Directory Restoration interfaces in cPanel and in WHM. For more information, read the How to Manage Metadata Settings documentation.

Default 0
Enum01
Example: backupmount=0
backupsuspendedacctsinteger

Whether to back up suspended accounts.

  • 1 — Back up.
  • 0 — Do not back up.
Default 0
Enum01
Example: backupsuspendedaccts=0
backuptypestring

The type of backup to create.

  • compressed
  • uncompressed
  • incremental
Default "compressed"
Enum"compressed""uncompressed""incremental"
Example: backuptype=compressed
check_min_free_spaceinteger

Whether to ensure that the destination server possesses the minimum free disk space available.

  • 1 — Check the free disk space on the destination server.
  • 0 — Do not check the free disk space on the destination server.
Default 1
Enum01
Example: check_min_free_space=1
disable_metadatainteger

Whether the backup system will create metadata when a backup runs.

  • 1 — Disable metadata creation.
  • 0 — Enable metadata creation.

Note:

This setting affects whether the system enables the File and Directory Restoration interfaces in cPanel and in WHM. For more information, read the How to Manage Metadata Settings documentation.

Default 0
Enum01
Example: disable_metadata=0
errorthreshholdinteger>= 0

The number of times that the system will try to use the additional backup destination.

Default 3
Example: errorthreshhold=3
force_prune_dailyinteger

Whether to strictly enforce the value of the backup_daily_retention parameter.

  • 1 — Strictly enforce the backup_daily_retention parameter.
  • 0 — Only enforce the backup_daily_retention parameter after a successful complete backup.
Default 0
Enum01
Example: force_prune_daily=0
force_prune_monthlyinteger

Whether to strictly enforce the value of the backup_monthly_retention parameter.

  • 1 — Strictly enforce the backup_monthly_retention parameter.
  • 0 — Only enforce the backup_monthly_retention parameter after a successful complete backup.
Default 0
Enum01
Example: force_prune_monthly=0
force_prune_weeklyinteger

Whether to strictly enforce the value of the backup_weekly_retention parameter.

  • 1 — Strictly enforce the backup_weekly_retention parameter.
  • 0 — Only enforce the backup_weekly_retention parameter after a successful complete backup.
Default 0
Enum01
Example: force_prune_weekly=0
gziprsyncoptsstring

The gzip environment variables.

Default ""
Example: gziprsyncopts=--rysncable
keeplocalinteger

Whether to delete backups from the local directory.

  • 1 — Delete.
  • 0 — Do not delete.

Note:

This setting affects whether the system enables the File and Directory Restoration interfaces in cPanel and in WHM. For more information, read the How to Manage Metadata Settings documentation.

Default 1
Enum01
Example: keeplocal=1
linkdestinteger

Whether to check the rsync function for hardlink support.

  • 1 — Check.
  • 0 — Do not check.
Default 0
Enum01
Example: linkdest=0
localzonesonlyinteger

Whether to use a local zone file from the /var/named/domain.tld file or the dnsadmin daemon, where domain.tld represents the target domain.

  • 1 — Use the /var/named/domain.tld file.
  • 0 — Use dnsadmin.
Default 0
Enum01
Example: localzonesonly=0
maximum_restore_timeoutinteger>= 0

How long a restoration will attempt to run, in seconds. If the restoration does not succeed in this amount of time, it will stop.

Default 21600
Example: maximum_restore_timeout=21600
maximum_timeoutinteger>= 0

How long a backup will attempt to run, in seconds. If the backup does not succeed in this amount of time, it will stop.

Default 7200
Example: maximum_timeout=7200
min_free_spaceinteger>= 0

The minimum amount of free disk to check for on the destination server.

Note:

If the value of the min_free_space_unit parameter is percent, the maximum value is 100.

Default 5
Example: min_free_space=1024
min_free_space_unitstring

The units of measurement of disk space for the min_free_space return.

  • MB — Megabytes.
  • percent — Percent available.
Default "percent"
Enum"MB""percent"
Example: min_free_space_unit=MB
mysqlbackupstring

The backup method to use for MySQL® databases.

  • accounts — Back up databases in each account's archive.
  • dir — Back up the entire MySQL directory.
  • both — Back up databases in each account's archive and the entire MySQL directory.
Default "accounts"
Enum"accounts""dir""both"
Example: mysqlbackup=accounts
postbackupinteger

Whether to run the /usr/local/cpanel/scripts/postcpbackup script after the backup finishes.

  • 1 — Run.
  • 0 — Do not run.
Default 0
Enum01
Example: postbackup=0
prebackupinteger

Whether to run the /usr/local/cpanel/scripts/precpbackup script before the system processes backups.

  • 1 — Run.
  • 0 — Do not run.
Default 1
Enum01
Example: prebackup=1
psqlbackupinteger

Whether to back up PostgreSQL® databases.

  • 1 — Back up.
  • 0 — Do not back up.
Default 0
Enum01
Example: psqlbackup=0
remote_restore_staging_dirstring

The directory that temporarily stores a remote backup's data during a backup restoration. The data is a compressed (.tar.gz) or uncompressed (.tar) account tarball.

Important:

The system restores backups one at a time. The backup staging directory must be large enough to contain the largest remote backup file that you wish to restore. For example, if you wish to restore three backups, sized 1.5 GB, 528 MB, and 950 MB each, your backup staging directory must be able to hold at least 1.5 GB.

Note:

The system empties the directory after the system restores the backup.

Example: remote_restore_staging_dir=/backup
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/backup_config_set?backup_daily_enable=1&backup_daily_retention=5&backup_monthly_dates=1&backup_monthly_enable=0&backup_monthly_retention=5&backup_weekly_day=1&backup_weekly_enable=0&backup_weekly_retention=4&backupaccts=1&backupbwdata=1&backupdays=0%2C1%2C2%2C3%2C4%2C5%2C6&backupdir=%2Fbackup&backupenable=0&backupfiles=1&backuplogs=0&backupmount=0&backupsuspendedaccts=0&backuptype=compressed&check_min_free_space=1&disable_metadata=0&errorthreshhold=3&force_prune_daily=0&force_prune_monthly=0&force_prune_weekly=0&gziprsyncopts=--rysncable&keeplocal=1&linkdest=0&localzonesonly=0&maximum_restore_timeout=21600&maximum_timeout=7200&min_free_space=1024&min_free_space_unit=MB&mysqlbackup=accounts&postbackup=0&prebackup=1&psqlbackup=0&remote_restore_staging_dir=%2Fbackup'

Responses

HTTP Request was successful.

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

Return dates where backup files exist

Request

This function lists the dates where backup file exists, whether stored locally or stored on remote backup destinations when local backups are disabled.

Security
BasicAuth
curl -i -X GET \
  -u <username>:<password> \
  https://api.docs.cpanel.net/_mock/specifications/whm.openapi/backup_date_list

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "backup_set": [] }, "metadata": { "command": "backup_date_list", "reason": "OK", "result": 1, "version": 1 } }

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