This function creates a cPanel account and sets up its domain information.
Note:
named
warning about the absence of SPF resource records on DNS.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.domain required | string The account's main domain. Example: domain=example.com |
username required | string <= 16 characters The new account's username. cPanel usernames must adhere to the following criteria:
Note:
Example: username=username |
string or Array of strings Assign Account Enhancements to the cPanel account. To view your server's Account Enhancements, run WHM API 1's account_enhancements=My Custom Enhancement&account_enhancements=Sample Enhancement account_enhancements=My Custom Enhancement | |
any or string or integer <megabytes> The account's maximum bandwidth.
Example: bwlimit=unlimited | |
cgi | integer Default: 1 Whether the account has Common Gateway Interface (CGI) access enabled.
Note: When a server profile disables the Web Server role, this parameter defaults to Example: cgi=1 |
contactemail | string <email> Default: "" The account's contact email address. Example: contactemail=username@example.com |
cpmod | string Example: cpmod=jupiter |
customip | string <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 |
dkim | integer Whether DomainKeys Identified Mail (DKIM) is enabled for the account.
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). Example: dkim=1 |
dmarc | integer Whether Domain-based Message Authentication, Reporting, and Conformance (DMARC) is enabled for the account.
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). Example: dmarc=1 |
featurelist | string Default: "default" The account's assigned feature list. Example: featurelist=feature_list |
forcedns | integer Default: 0 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.
Example: forcedns=0 |
frontpage | integer or null Deprecated Default: null Whether the account has Microsoft® FrontPage Extensions enabled. Note: cPanel & WHM ignores all FrontPage settings and parameters. |
gid | integer >= 1 The account's group ID. Note:
Example: gid=123456789 |
hasshell | integer Default: 0 Whether the account has shell (SSH) access enabled.
Example: hasshell=0 |
hasuseregns | integer Default: 0 A legacy parameter.
Important: Only include this parameter if you set a useregns value of 1. Example: hasuseregns=1 |
homedir | string The absolute path to the account's Note:
Example: homedir=/home/user |
ip | string Default: "n" Whether the account has a dedicated IP address.
Example: ip=n |
language | string The account's default locale. Note:
Example: language=en |
mail_node_alias | string 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_format | string A mailbox format to use, if you do not wish to use the system's default mailbox format. Note:
Example: mailbox_format=mdbox |
string or integer Default: "unlimited" 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.
Example: max_defer_fail_percentage=unlimited | |
string or integer The maximum number of emails that the account can send in one hour.
Example: max_email_per_hour=unlimited | |
string or integer <megabytes> Default: 1024 The maximum size that the account can define when it creates an email account.
Important:
Example: max_emailacct_quota=1024 | |
max_team_users | integer [ 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 |
any or string or integer Default: 0 The account's maximum number of addon domains.
Example: maxaddon=unlimited | |
any or string or integer The account's maximum number of FTP accounts.
Example: maxftp=unlimited | |
any or string or integer The account's maximum number of mailing lists.
Example: maxlst=unlimited | |
any or string or integer Default: 0 The account's maximum number of parked domains (aliases).
Example: maxpark=unlimited | |
any or string or integer The account's maximum number of email accounts.
Example: maxpop=unlimited | |
any or string or integer The account's maximum number of each available type of SQL database.
For example, this parameter has a
Example: maxsql=unlimited | |
any or string or integer The account's maximum number of subdomains.
Example: maxsub=unlimited | |
mxcheck | string Default: "local" The account's main mail exchanger's type.
Note: The function does not configure the primary MX entry to point to the appropriate exchanger. You must perform this function separately. Example: mxcheck=auto |
owner | string The name of the account owner.
Example: owner=root |
ownerself | integer Default: 0 Set the account to own itself. Ignored if
Example: ownerself=1 |
pass | string The account's password. Note:
Example: pass=123456luggage |
password | string The account's password. Note:
Example: password=123456luggage |
pkgname | string A new plan name. Use this parameter to save unique account settings as a new plan. Note:
Example: pkgname=my_new_package |
plan | string Default: "default" 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. Example: plan=default |
quota | integer <megabytes> [ 0 .. 999999 ] Default: 0 The account's disk space quota.
Example: quota=500 |
reseller | integer Default: 0 Whether to grant reseller privileges to the account.
Example: reseller=0 |
reseller_without_domain | integer Default: 0 Create the user 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. Example: reseller_without_domain=0 |
savepkg | integer Default: 0 Whether to save the account's settings as a new plan.
Example: savepkg=1 |
showpass | string Default: "y" Whether to display the account password in the output.
Example: showpass=n |
spamassassin | integer Default: 1 Whether the account has Apache SpamAssassin™ enabled.
Example: spamassassin=1 |
spambox | string Default: "y" Whether to enable spam box filtering for the account.
You must enable Apache SpamAssassin™ to use the Spam Box feature. Example: spambox=y |
spf | integer Whether Sender Policy Framework (SPF) is enabled for the account.
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). Example: spf=1 |
uid | integer >= 0 The account's user ID. Note:
Example: uid=123456789 |
useregns | integer Default: 0 Whether to use registered nameservers for the domain.
Important: If you set this parameter to Example: useregns=0 |
HTTP Request was successful.
object | |
object |
whmapi1 --output=jsonpretty \ createacct \ username='username' \ domain='example.com'
{- "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": {
- "raw": "Checking input data...Forced Dns is enabled.\\nValidating Username......Done\\nValidating IP......Done\\nValidating Contact Email......Done\\n...Done\\nValidating system setup......Done\\nChecking for database conflicts......Done\\nWWWAcct 12.6.0 (c) 2024 WebPros International, LLC...\\n\\n+===================================+\\n| New Account Info |\\n+===================================+\\n| Domain: example.com\\n| Ip: 192.0.2.0 (n)\\n| HasCgi: y\\n| UserName: username\\n| PassWord: 123456luggage\\n| CpanelMod: jupiter\\n| HomeRoot: /home\\n| Quota: 1 GB\\n| NameServer1: ns1.example.com\\n| NameServer2: ns2.example.com\\n| NameServer3:\\n| NameServer4:\\n| Contact Email: username@example.com\\n| Package: my_new_package\\n| Feature List: feature_list\\n| Language: en\\n+===================================+\\n...Done\\nCustom Account Data Provided: no\\nRunning pre creation script (/usr/local/cpanel/scripts/prewwwacct)......Done\\nAdding User...Removing Shell Access (n)\\nSuccess...Done\\nAdding Entries to userdata......Done\\nSetting up Mail & Local Domains...localdomains...valiases ...vdomainaliases ...vfilters ......Done\\nConfiguring DNS...Zone example.com has been successfully added\\n...Done\\nVerifying MX Records and Setting up Databases...Reconfiguring Mail Routing:\\nLOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for example.com's mail.:\\n This configuration has been automatically detected based on your mx entries.\\n\\n...Done\\nSetting up Service Subdomains......Done\\nUpdating Authentication Databases......Done\\nSetting passwords......Done\\nUpdating the userdata cache......Done\\n\\nCreating bandwidth datastore......Done\\nUpdating the dedicated IP address usage cache......Done\\nGenerating and installing DKIM keys......Done\\nEnabling Apache SpamAssassin......Done\\nEnabling Apache SpamAssassin Spam Box......Done\\nSending Account Information......Done\\nRunning post creation scripts (/usr/local/cpanel/scripts/legacypostwwwacct, /usr/local/cpanel/scripts/postwwwacct, /usr/local/cpanel/scripts/postwwwacctuser)......Done\\nwwwacct creation finished\\nAccount Creation Complete!!!...Account Creation Ok...Done\\n"
}, - "reason": "Account Creation Ok",
- "result": 1,
- "version": 1
}
}