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

Request

This function creates a cPanel account and sets up its domain information.

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
usernamestring<= 16 charactersrequired

The new account's username. cPanel usernames must adhere to the following criteria:

  • The first eight characters of a username must be unique.
  • A username cannot begin with a number or the test string.

Note:

  • Use the Cpanel::Validate::Username Perl module to validate usernames before you call this function. For more information, read the /usr/local/cpanel/Cpanel/Validate/Username.pod file.
  • The system will automatically convert this value to all lowercase letters.
  • MySQL's unique character limitations do not exist on servers that use MariaDB.
Example: username=username
account_enhancementsstring or Array of strings

Assign Account Enhancements to the cPanel account. To view your server's Account Enhancements, run WHM API 1's list_account_enhancements function.

Examples:
account_enhancements=My Custom Enhancement&account_enhancements=Sample Enhancement
account_enhancements=My Custom Enhancement
One of:
string
bwlimitany or string or integer(megabytes)

The account's maximum bandwidth.

  • 0, unlimited, or null — The account possesses unlimited bandwidth.
Example: bwlimit=unlimited
One of:
any(megabytes)
Valuenull
cgiinteger

Whether the account has Common Gateway Interface (CGI) access enabled.

  • 1 — Enabled.
  • 0 — Disabled.

Note:

When a server profile disables the Web Server role, this parameter defaults to 0. On these servers, you cannot enable CGI access.

Default 1
Enum10
Example: cgi=1
contactemailstring(email)

The account's contact email address.

Default ""
Example: contactemail=username@example.com
cpmodstring

The account's cPanel theme.

Note:

This parameter defaults to the server's default cPanel theme.

Example: cpmod=jupiter
customipstring(ipv4)

The account's IP address.

Note:

If you do not specify this parameter, the system will determine the account's IP address.

Example: customip=192.0.2.0
dkiminteger

Whether DomainKeys Identified Mail (DKIM) is enabled for the account.

  • 1 — Enabled.
  • 0 — Disabled.

Note:

This parameter defaults to the Enable DKIM on domains for newly created accounts setting's value in WHM's Tweak Settings interface (WHM >> Home >> System Configuration >> Tweak Settings).

Enum01
Example: dkim=1
dmarcinteger

Whether Domain-based Message Authentication, Reporting, and Conformance (DMARC) is enabled for the account.

  • 1 — Enabled.
  • 0 — Disabled.

Note:

This parameter defaults to the Enable DMARC on domains for newly created accounts setting's value in the Domains section of WHM's Tweak Settings interface (WHM >> Home >> System Configuration >> Tweak Settings).

Enum01
Example: dmarc=1
domainstring

The account's main domain.

Note:

  • If you do not provide a domain, the system will automatically create a temporary domain for the account.
  • For more information about temporary domains, read our Temporary Domains documentation.
Example: domain=example.com
featureliststring

The account's assigned feature list.

Default "default"
Example: featurelist=feature_list
forcednsinteger

Whether to overwrite an existing DNS zone with the new account's information. The system performs this action if a matching DNS zone currently exists.

  • 1 — Overwrite.
  • 0 — Do not overwrite.
Default 0
Enum01
Example: forcedns=0
gidinteger>= 1

The account's group ID.

Note:

  • To use this parameter, the function's caller must authenticate as the root user.
  • If you do not specify this parameter, the system generates a group ID.
  • This must be a unique value that is not currently associated with disk usage and does not exist on the server.
Example: gid=123456789
hasshellinteger

Whether the account has shell (SSH) access enabled.

  • 1 — Enabled.
  • 0 — Disabled.
Default 0
Enum01
Example: hasshell=0
hasuseregnsinteger

A legacy parameter.

  • 1 — Enabled.
  • 0 — Disabled.

Important:

Only include this parameter if you set a useregns value of 1.

Default 0
Enum01
Example: hasuseregns=1
homedirstring

The absolute path to the account's home directory.

Note:

  • To use this parameter, the function's caller must authenticate as the root user.
  • If you do not specify a value, the system uses the /home/user directory, where user is the account's username.
Example: homedir=/home/user
ipstring

Whether the account has a dedicated IP address.

  • y — The account possesses a dedicated IP address.
  • n — The account does not possess a dedicated IP address.
Default "n"
Enum"y""n"
Example: ip=n
languagestring

The account's default locale.

Note:

  • This value is case-sensitive.
  • For region-specific locales, use the ISO 639-1 code, an underscore (_), and the ISO 3166-1 code.
Example: language=en
mail_node_aliasstring

A linked cPanel mail server on which to also create the account. This is the server's alias (friendly name) defined when creating the link to a cPanel mail server.

Note:

This function requires a linked cPanel mail server.

Example: mail_node_alias=mailnode
mailbox_formatstring

A mailbox format to use, if you do not wish to use the system's default mailbox format.

Note:

  • Use this parameter when you transfer between servers with different mailbox formats.
  • This parameter defaults to the The mailbox storage format for new accounts setting in the Mail section of WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings).
Enum"mdbox""maildir"
Example: mailbox_format=mdbox
max_defer_fail_percentagestring or integer

The percentage of failed or deferred email messages that the account can send per hour. If the account exceeds this value its outgoing mail is rate-limited.

  • 0 or unlimited — The account can send an unlimited number of failed or deferred messages.
Default "unlimited"
Example: max_defer_fail_percentage=unlimited
One of:
string
Default "unlimited"
Value"unlimited"
max_email_per_hourstring or integer

The maximum number of emails that the account can send in one hour.

  • 0 or unlimited — The account can send an unlimited number of emails.
Example: max_email_per_hour=unlimited
One of:
string
Value"unlimited"
max_emailacct_quotastring or integer(megabytes)

The maximum size that the account can define when it creates an email account.

  • 0 or unlimited — The account possesses an unlimited quota.

Important:

  • This value applies to each email account, not each cPanel account.
  • If you define this parameter it overwrites the hosting plan's defined value for the account.
  • We recommend that you allow the account's plan to determine this value.
Default 1024
Example: max_emailacct_quota=1024
One of:
string(megabytes)
Default 1024
Value"unlimited"
max_team_usersinteger[ 0 .. 7 ]

The maximum number of Team users for this account. This parameter should be a number between 0 and the server's default value, inclusively. This parameter can not be a number greater than the server's default value.

Example: max_team_users=7
maxaddonany or string or integer

The account's maximum number of addon domains.

  • unlimited, or null — The account possesses unlimited addon domains.
Default 0
Example: maxaddon=unlimited
One of:
any
Default 0
Valuenull
maxftpany or string or integer

The account's maximum number of FTP accounts.

  • 0, unlimited, or null — The account possesses unlimited FTP accounts.
Example: maxftp=unlimited
One of:
any
Valuenull
maxlstany or string or integer

The account's maximum number of mailing lists.

  • 0, unlimited, or null — The account possesses unlimited mailing lists.
Example: maxlst=unlimited
One of:
any
Valuenull
maxparkany or string or integer

The account's maximum number of parked domains (aliases).

  • unlimited or null — The account possesses unlimited parked domains.
Default 0
Example: maxpark=unlimited
One of:
any
Default 0
Valuenull
maxpopany or string or integer

The account's maximum number of email accounts.

  • 0, unlimited, or null — The account possesses unlimited email accounts.
Example: maxpop=unlimited
One of:
any
Valuenull
maxsqlany or string or integer

The account's maximum number of each available type of SQL database. For example, this parameter has a 5 value and the system administrator allows MySQL® and PostgreSQL® databases. Users can create up to five MySQL databases and up to five PostgreSQL databases.

  • 0, unlimited, or null — The account possesses unlimited databases.
Example: maxsql=unlimited
One of:
any
Valuenull
maxsubany or string or integer

The account's maximum number of subdomains. unlimited or null — The account possesses unlimited subdomains.

Example: maxsub=unlimited
One of:
any
Valuenull
mxcheckstring

The account's main mail exchanger's type.

  • local - Local Mail Exchanger.
  • secondary - Backup Mail Exchanger.
  • remote - Remote Mail Exchanger.
  • auto - Automatically Detect Configuration.

Note:

The function does not configure the primary MX entry to point to the appropriate exchanger. You must perform this function separately.

Default "local"
Enum"local""secondary""remote""auto"
Example: mxcheck=auto
ownerstring

The name of the account owner.

  • root
  • A valid reseller account username on the server.
Example: owner=root
ownerselfinteger

Set the account to own itself. Ignored if owner is set.

  • 1 — Set account to own itself.
  • 0 — Do nothing.
Default 0
Enum01
Example: ownerself=1
passstring

The account's password.

Note:

  • You can use either the pass or the password parameter, but not both.
  • If you don't specify this value, the system generates a secure password.
Example: pass=123456luggage
passwordstring

The account's password.

Note:

  • You can use either the pass or the password parameter, but not both.
  • If you don't specify this value, the system generates a secure password.
Example: password=123456luggage
pkgnamestring

A new plan name. Use this parameter to save unique account settings as a new plan.

Note:

  • If you do not use this parameter but specify 1 for the savepkg value, the system will generate a plan name.
  • If you do not use this parameter and specify 0 or do not use the savepkg parameter, the function does not save a new plan.
  • If you do not use this parameter, the function will not save the new account settings.
Example: pkgname=my_new_package
planstring

The account's hosting plan (package).

Important:

If you provide this value, do not use the optional quota-related parameters below. Instead, we recommend that you allow the account's plan to determine these values.

Default "default"
Example: plan=default
quotainteger(megabytes)[ 0 .. 999999 ]

The account's disk space quota.

  • 0 — The account's disk space is unlimited.
Default 0
Example: quota=500
resellerinteger

Whether to grant reseller privileges to the account.

  • 1 — Grant reseller privileges.
  • 0 — Do not grant reseller privileges.
Default 0
Enum01
Example: reseller=0
reseller_without_domaininteger

Create the user as a reseller without an associated domain.

  • 1 - Create the account as a reseller without an associated domain.
  • 0 - Do not create the account as a reseller without an associated domain.

Warning:

If you create a reseller without a domain, certain parts of WHM will not function for that user. These limitations exist both when logged in as that user and when you attempt to perform actions which affect that user.

Default 0
Enum01
Example: reseller_without_domain=0
savepkginteger

Whether to save the account's settings as a new plan.

  • 1 — Save.
  • 0 — Do not save.
Default 0
Enum01
Example: savepkg=1
showpassstring

Whether to display the account password in the output.

  • y — Display the account password in the output.
  • n — Do NOT display the account password in the output.
Default "y"
Enum"y""n"
Example: showpass=n
spamassassininteger

Whether the account has Apache SpamAssassin™ enabled.

  • 1 — Enabled.
  • 0 — Disabled.
Default 1
Enum01
Example: spamassassin=1
spamboxstring

Whether to enable spam box filtering for the account.

  • y - Enable spam box filtering.
  • n - Disable spam box filtering. Note:

You must enable Apache SpamAssassin™ to use the Spam Box feature.

Default "y"
Enum"y""n"
Example: spambox=y
spfinteger

Whether Sender Policy Framework (SPF) is enabled for the account.

  • 1 — Enabled.
  • 0 — Disabled.

This parameter defaults to the Enable SPF on domains for newly created accounts setting's value in WHM's Tweak Settings interface (WHM >> Home >> System Configuration >> Tweak Settings).

Enum01
Example: spf=1
uidinteger>= 0

The account's user ID.

Note:

  • To use this parameter, the function's caller must authenticate as the root user.
  • If you do not specify this parameter, the system generates a user ID.
  • This must be a unique value that is not currently associated with disk usage and does not exist on the server.
Example: uid=123456789
useregnsinteger

Whether to use registered nameservers for the domain.

  • 1 - Use registered nameservers.
  • 0 - Use the server's default nameservers.

Important:

If you set this parameter to 1, you must also include the hasuseregns parameter with a value of 1.

Default 0
Enum01
Example: useregns=0
frontpageinteger or nullDeprecated

Whether the account has Microsoft® FrontPage Extensions enabled.

Note:

cPanel & WHM ignores all FrontPage settings and parameters.

Default null
curl -i -X GET \
  -u <username>:<password> \
  'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/createacct?username=username&account_enhancements=string&bwlimit=unlimited&cgi=1&contactemail=username%40example.com&cpmod=jupiter&customip=192.0.2.0&dkim=1&dmarc=1&domain=example.com&featurelist=feature_list&forcedns=0&gid=123456789&hasshell=0&hasuseregns=1&homedir=%2Fhome%2Fuser&ip=n&language=en&mail_node_alias=mailnode&mailbox_format=mdbox&max_defer_fail_percentage=unlimited&max_email_per_hour=unlimited&max_emailacct_quota=1024&max_team_users=7&maxaddon=unlimited&maxftp=unlimited&maxlst=unlimited&maxpark=unlimited&maxpop=unlimited&maxsql=unlimited&maxsub=unlimited&mxcheck=auto&owner=root&ownerself=1&pass=123456luggage&password=123456luggage&pkgname=my_new_package&plan=default&quota=500&reseller=0&reseller_without_domain=0&savepkg=1&showpass=n&spamassassin=1&spambox=y&spf=1&uid=123456789&useregns=0'

Responses

HTTP Request was successful.

Bodyapplication/json
dataobject
metadataobject
Response
application/json
{ "data": { "ip": "192.0.2.0", "nameserver": "ns1.example.com", "nameserver2": "ns2.example.com", "nameserver3": "ns3.example.com", "nameserver4": "ns4.example.com", "nameservera": "192.0.2.1", "nameservera2": "192.0.2.2", "nameservera3": "192.0.2.3", "nameservera4": "192.0.2.4", "nameserverentry": "dnsentry1", "nameserverentry2": "dnsentry2", "nameserverentry3": "dnsentry3", "nameserverentry4": "dnsentry4", "package": "my_new_package" }, "metadata": { "command": "createacct", "output": {}, "reason": "Account Creation Ok", "result": 1, "version": 1 } }

Return cPanel accounts total number

Request

This function returns the number of cPanel accounts on the server.

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

Responses

HTTP Request was successful.

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

Return maximum accounts for license

Request

This function returns the maximum number of cPanel accounts that the server's license allows.

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

Responses

HTTP Request was successful.

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

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