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

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

Request

This function creates a DNS zone. If trueowner=user, this function does the following:

  • Adds a DNS entry in the /var/cpanel/users/USER file, where USER represents the trueowner parameter's value.
  • Creates the /etc/vdomainaliases/DOMAIN file, where DOMAIN represents the new zone's domain.
  • Creates the /etc/vfilters/DOMAIN file, where DOMAIN represents the new zone's domain.

When you call this function, the system uses the domain name and IP address that you supply. WHM's standard zone template determines all other zone information.

This function generates the DNS zone's MX record, domain PTR, and A records automatically.

Important:

When you disable the DNS role, the system disables this function.

NOTE:

You cannot use this function to add temporary domains.

Security
BasicAuth
Query
domainstring(domain)required

The new zone's domain.

Example: domain=example.com
ipstring(ipv4)required

The domain's IP address.

Example: ip=192.168.0.20
ipv6string or null(ipv6)

The domain's IPv6 address.

Example: ipv6=2001:0db8:0:0:1:0:0:1
templatestring

The zone file template.

  • standard
  • simple
  • standardvirtualftp
  • The name of a custom zone template file in the /var/cpanel/zonetemplates directory.
Default "standard"
Example: template=standard
trueownerstring or null(username)

The new zone's owner. This parameter defaults to the currently-authenticated user.

Example: trueowner=user
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/adddns?domain=example.com&ip=192.168.0.20&ipv6=2001%3A0db8%3A0%3A0%3A1%3A0%3A0%3A1&template=standard&trueowner=user'

Responses

HTTP Request was successful.

Bodyapplication/json
metadataobject
Response
application/json
{ "metadata": { "command": "adddns", "reason": "Added example.com ok belonging to user user", "result": 1, "version": 1 } }

Return whether DNS cluster server can share records

Request

This function queries whether nameservers in a DNS cluster can share records with one another. Servers in a DNS cluster must exist in a Reverse Trust relationship to share information. This relationship requires each server to have an API token.

Note:

DNS servers in a Write-Only role do not need to exist in a Reverse Trust relationship. For more information, read our Guide to DNS Cluster Configurations documentation.

Security
BasicAuth
Query
hoststring(ipv4)required

The nameserver's IP address.

Example: host=192.0.2.0
althoststring(ipv4)

The nameserver's alternate IP address. This is useful, for example, if your DNS cluster exists in a NAT-configured network.

Default ""
Example: althost=192.0.3.0
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/cluster_member_has_trust_with?host=192.0.2.0&althost=192.0.3.0'

Responses

HTTP Request was successful.

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

Request

This function edits a DNS zone record. To effectively use this function, use the following workflow:

  1. Run the dumpzone function on the DNS zone record to edit.
  2. Locate the Line value that corresponds to the data to edit.
  3. Use the values from that zone record to formulate the appropriate editzonerecord parameters.

Important:

  • When you call this function, you must include the additional parameters for the selected zone record type.
  • To change the zone record's IP address, we recommend that you use the swapip script or the setsiteip function instead.
  • You cannot edit other DNS zones that reside on Write-only servers in a DNS cluster.

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.

Important:

When you disable the DNS role, the system disables this function.

Security
BasicAuth
Bodyapplication/x-www-form-urlencodedrequired

The updated DNS Zone Record.

classstring

The record's class.

If you do not use this parameter, the system retains the current setting.

Example: "IN"
One of:

The record's class.

If you do not use this parameter, the system retains the current setting.

string

The record's class.

If you do not use this parameter, the system retains the current setting.

Value"IN"
domainstring(domain)required

The zone record's domain.

Example: "example.com"
lineinteger>= 1required

The zone record's file line number.

Example: 24
namestring(domain)

The record's name.

If you do not use this parameter, the system retains the current setting.

Note:

Do not omit any necessary trailing periods.

You cannot use this function to modify temporary domains.

Example: "hostname.example.com."
ttlinteger>= 1required

The record's Time To Live (TTL), in seconds.

Example: 86400
typestring

The DNS record type:

  • A - A records store IPv4 addresses. Use them to map a hostname to an IPv4 address.
  • A6 - A6 records store IPv6 addresses.
  • AAAA - AAAA records store IPv6 addresses.
  • AFSDB - AFSDB records store the location of an AFS cell's database servers.
  • ALIAS - ALIAS records create an alias to another hostname, but can coexist with other records on that name. We strongly discourage using this record type.
  • CAA - CAA records control which certificate authorities can issue SSL certificates for a domain.
  • CNAME - CNAME records create an alias to another hostname.
  • DNAME - DNAME records create an alias for a hostname and its subnames.
  • DS - DS records specify a record's delegation signer.
  • HINFO - HINFO records specify a host's CPU and OS types.
  • LOC - LOC records store a hostname's geographical location.
  • MX - MX records point a domain name to its MTAs.
  • NS - NS records store a domain's authoritative nameservers.
  • PTR - PTR records point to a CNAME.
  • RP - RP records store a domain's Responsible Person's information.
  • SOA - SOA records designate the beginning of a zone of authority.
  • SRV - SRV records store the service location records for newer protocols (for example, Autodiscover).
  • TXT - TXT records store descriptive text or useful records (for example, SPF or DKIM records).

If you do not use this parameter, the system retains the current setting.

Warning:

Additional properties may be required based on the type.

When you call this function, you must include the additional parameters for the desired zone record type if you use this parameter. Select a zone record from the menu to view the required additional parameters:

Enum"A""AAAA""AFSDB""ALIAS""CAA""CNAME""DNAME""DS""HINFO""LOC"
Example: "A"
Discriminator
addressstring(ipv4)required

The zone record's IPv4 address.

Note:

For more information about A records, read RFC 1035 at IANA.

Example: "192.168.0.20"
curl -i -X POST \
  -u <username>:<password> \
  https://api.docs.cpanel.net/_mock/specifications/whm.openapi/editzonerecord \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d class=IN \
  -d domain=example.com \
  -d line=24 \
  -d name=hostname.example.com. \
  -d ttl=86400 \
  -d type=A \
  -d address=192.168.0.20

Responses

HTTP Request was successful.

Bodyapplication/json
metadataobject
Response
application/json
{ "metadata": { "command": "editzonerecord", "reason": "Bind reloading on hostname using rndc zone: [example.com]\n", "result": 1, "version": 1 } }

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