cPanel/AddonDomain
cPanel module

AddonDomain

3 functions, invoked through the cpanel_uapi tool.

List, add or remove addon domains (each backed by a subdomain) → SubDomain, DomainInfo

scope cpanel:uapidns
Call any function with cpanel_uapi(service_id, module="AddonDomain", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

addaddondomain POST mutating#

Create an addon domain

This function creates an addon domain, backed by a new subdomain of the account's main domain.

JetHost note: ALWAYS pass dir, e.g. public_html/<newdomain>. When dir is omitted the document root is /home/<user>/<subdomain>, outside public_html. The domain does not need to exist in WHMCS; cPanel rejects a domain that is already hosted on another account, and a repeated add fails because the backing subdomain already exists.

newdomainstringRequired
The addon domain to create, e.g. example.net.
subdomainstringRequired
The label of the backing subdomain, e.g. example for example.<maindomain>. cPanel derives the addon domain's domainkey (label_maindomain.tld) from it.
dirstringOptional
The document root, relative to the home directory, e.g. public_html/example.net. JetHost note: always pass it — when omitted the document root is /home/<user>/<subdomain>, outside public_html.

deladdondomain POST mutating#

Delete an addon domain

This function deletes an addon domain together with its backing subdomain.

JetHost note: subdomain MUST be the domainkey form label_maindomain.tld returned by listaddondomains; cPanel refuses a value that does not correspond to domain.

domainstringRequired
The addon domain to delete, e.g. example.net.
subdomainstringRequired
The addon domain's domainkey from listaddondomains, in the form label_maindomain.tld (e.g. example_maindomain.com).

listaddondomains GET#

List addon domains

This function lists the account's addon domains. Each row carries domain, domainkey, subdomain, rootdomain, dir, basedir, fullsubdomain and status.

JetHost note: status is a redirect description string (e.g. not redirected), not a success flag. domainkey (label_maindomain.tld) is the value deladdondomain expects for its subdomain parameter.

No parameters.