cPanel/DomainInfo
cPanel module

DomainInfo

5 functions, invoked through the cpanel_uapi tool.

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

domains_data GET#

Return all domains' hosting configuration

This function lists user data for the cPanel account's domains.

Note:

This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain. For this reason, actual output may not contain all of the returns that this document lists.

formatstringOptional
The function's return format. hash — Use a hash format. The function will return objects based on the domain type. list — Use a list format. The function will return an array of objects, where each object is a domain.
hide_temporary_domainsintegerOptional
Whether to hide temporary domains from the response arrays. 1 — Hide temporary domains from addon_domains, sub_domains, and parked_domains arrays. 0 — Return all domains, including the temporary domains.
return_https_redirects_statusintegerOptional
Whether to return the secure redirect status of the addon domains. 1 — Return the status. 0 — Do not return the status.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

An object containing information about a cPanel account's domains. The output of this function changes, based on the format parameter value.

list_domains GET#

Return cPanel account's domains

This function lists the cPanel account's domains.

Note:

For this function to succeed, the /var/cpanel/userdata/username/main file (where username represents the authenticated user) must possess the correct permissions. If a permissions error occurs, this function returns blank values for all of its returns and does not return an error message.

hide_temporary_domainsintegerOptional
Whether to hide temporary domains from the response arrays. 1 — Hide temporary domains from the addon_domains, sub_domains, and parked_domains arrays, and from the main_domain field. 0 — Return all domains, including the temporary domains.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

addon_domainsarray<string>
An array of string values that lists the addon domains on the cPanel account.
main_domainstring
The cPanel account's main domain.
parked_domainsarray<string>
An array of string values that lists the parked domains on the cPanel account.
sub_domainsarray<string>
An array of string values that lists the subdomains on the cPanel account.
is_temporaryobject
Whether the domain is a temporary domain.

main_domain_builtin_subdomain_aliases GET#

Return built-in subdomain aliases

This function returns the built-in subdomain aliases for an account's main domain.

Note:

This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain. For this reason, actual output may not contain all of the returns that this document lists.

hide_temporary_domainsintegerOptional
Whether to hide domain aliases if the main domain is a temporary domain. 1 — Return empty array if the main domain is a temporary domain. 0 — Show aliases regardless of domain type.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

A list of the built-in subdomain aliases for the account's main domain.

primary_domain GET#

Return the cPanel account's primary domain

This function returns the cPanel account's main domain.

hide_temporary_domainsintegerOptional
Whether to hide temporary domains from the response. 1 — Return null if the main domain is a temporary domain. 0 — Return the main domain if it's a temporary domain.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

primary_domainstring
The cPanel account's main domain. Note: This return's value will be null if the hide_temporary_domains parameter is set to 1 and the main domain is a temporary domain.

single_domain_data GET#

Return domain's hosting configuration

This function lists user data for a domain.

Important:

This function retrieves data from the /var/cpanel/userdata/user/domain file, where user represents the cPanel account username and domain represents the domain.

  • Because aliases (parked domains) do not use a user data file, this function cannot query information for aliases. To retrieve information for an alias, specify the associated main or addon domain.
  • Due to differences in user data files, the function's actual output may not contain all of the returns that this document lists.
domainstringRequired
The domain on the cPanel account. Important: Do not specify an alias (parked domain).
hide_temporary_domainsintegerOptional
Whether to hide temporary domains from the returned values. 1 — Return an error if the requested domain is a temporary domain. 0 — Return all domains, including the temporary domains. Note: If you set this parameter's value to 1 and the requested domain is temporary, the function will return an error similar to the following example: Domain [example.com] is a temporary domain and hide_temporary_domains is enabled.
return_https_redirect_statusintegerOptional
Whether to return the secure redirect status of the addon domains. 1 - Return status. 0 - Do not return status.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

all_aliases_validinteger
Whether a valid SSL certificate exists on the domain's aliases. 1 - A valid SSL certificate exists on the aliases. 0 - A valid SSL certificate does not exist on the aliases. Important: This return only appears if you set the return_https_redirects_status parameter to 1.
One of: 0 1
can_https_redirectinteger
Whether a valid SSL certificate exists or AutoSSL runs on the domain. 1 - A valid SSL certificate exists or AutoSSL runs. 0 - A valid SSL certificate does not exist, and AutoSSL does not run. Important: This return only appears if you set the return_https_redirects_status parameter to 1.
One of: 0 1
customlogobject
An object containing Apache log information.
domainstring
The target log file's domain. An Apache log domain. Generally, this value is combined.
targetstring
The absolute path to the domain's log file.
documentrootstring
The absolute path to the domain's document root.
domainstring
The domain name on the cPanel account.
groupstring
The domain's group name.
hascgiinteger
Whether CGI is enabled for the domain. 1 - Enabled. 0 - Disabled.
One of: 0 1
homedirstring
The absolute path to the account's home directory.
ifmodulemodsuphpcobject
An object containing information about PHP scripts and suPHP.
groupstring
If suPHP is enabled, the group that PHP scripts run as.
ipstring
The domain's IP address.
is_https_redirectinginteger
Whether the domain redirects to https. 1 - Redirects. 0 - Does not redirect. Important: This return only appears if you set the return_https_redirects_status parameter to 1.
One of: 0 1
is_temporaryinteger
Whether the domain is a temporary domain. 1 — The domain is temporary. 0 — The domain is not temporary.
One of: 0 1
optionsstring
The Apache Options directive for the domain.
ownerstring
The WHM account (root or a reseller) that owns the cPanel account.
phpopenbasedirprotectinteger
The domain's open_basedir setting. 1 - Enabled. 0 - Disabled. Note: In EasyApache 4, change this directive in the Editor Mode section of WHM's MultiPHP INI Editor interface (WHM >> Home >> Software >> MultiPHP INI Editor).
One of: 0 1
portinteger
Apache's port to access the domain.
scriptaliasobject
An object containing CGI information.
pathstring
The absolute path to the domain's CGI directory.
urlstring
The domain's CGI directory.
serveradminstring
The domain's administrator's contact email address.
serveraliasstring
A space-separated list of the domain's aliases.
servernamestring
The domain's identifier on the server.
typestring
The domain type. addon_domain - The domain is an addon domain. sub_domain - The domain is a subdomain. main_domain - The domain is the account's main domain. parked_domain - The domain is a parked domain (domain alias).
One of: addon_domain sub_domain main_domain parked_domain
usecanonicalnamestring
The domain's Canonical Name (CNAME) setting. On - Use the CNAME. Off - Do not use the CNAME.
One of: On Off
userstring
The cPanel account's username.
userdirprotectinteger
The domain's Apache mod_userdir Tweak setting. 1 - Enabled. 0 - Disabled.
One of: 0 1