Skip to content

SubDomains

SubDomains.add

add a new subdomain

Permission

admin customer

Parameter

FieldTypeDescription
subdomainstringpart before domain.tld to create as subdomain
domainstringdomainname of main-domain
aliasintoptional, domain-id of a domain that the new domain should be an alias of
pathstringoptional, destination path relative to the customers-homedir, default is customers-homedir
urlstringoptional, overwrites path value with an URL to generate a redirect, alternatively use the pathparameter also for URLs
openbasedir_pathintoptional, either 0 for domains-docroot [default], 1 for customers-homedir or 2 for parent-directory of domains-docroot
phpsettingidintoptional, php-settings-id, if empty the $domain value is used
redirectcodeintoptional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
speciallogfileintoptional, whether to create an exclusive web-logfile for this domain (1) or not (0) or inherit value from parentdomain (2, default)
sslenabledbooloptional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default1 (true)
ssl_redirectbooloptional, whether to generate a https-redirect or not, default false; requires SSL to be enabled
letsencryptbooloptional, whether to generate a Let's Encrypt certificate for this domain, default false; requiresSSL to be enabled
http2booloptional, whether to enable http/2 for this subdomain (requires to be enabled in the settings),default 0 (false)
hsts_maxageintoptional max-age value for HSTS header, default 0
hsts_subbooloptional whether or not to add subdomains to the HSTS header, default 0
hsts_preloadbooloptional whether or not to preload HSTS header value, default 0
customeridintoptional, required when called as admin (if $loginname is not specified)
loginnamestringoptional, required when called as admin (if $customerid is not specified)

Response

string as json-encoded array

SubDomains.get

return a subdomain entry by either id or domainname

Permission

admin customer

Parameter

FieldTypeDescription
idintoptional, the domain-id
domainnamestringoptional, the domainname
with_ipsbooloptional, default true

Response

string as json-encoded array

SubDomains.update

update subdomain entry by either id or domainname

Permission

admin customer

Parameter

FieldTypeDescription
idintoptional, the domain-id
domainnamestringoptional, the domainname
aliasintoptional, domain-id of a domain that the new domain should be an alias of
pathstringoptional, destination path relative to the customers-homedir, default is customers-homedir
urlstringoptional, overwrites path value with an URL to generate a redirect, alternatively use the pathparameter also for URLs
selectserveraliasintoptional, 0 = wildcard, 1 = www-alias, 2 = none
isemaildomainbooloptional
openbasedir_pathintoptional, either 0 for domains-docroot, 1 for customers-homedir or 2 for parent-directory of domains-docroot
phpsettingidintoptional, php-settings-id, if empty the $domain value is used
redirectcodeintoptional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
speciallogfilebooloptional, whether to create an exclusive web-logfile for this domain
speciallogverifiedbooloptional, when setting $speciallogfile to false, this needs to be set to true to confirm the action,default 0 (false)
sslenabledbooloptional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default1 (true)
ssl_redirectbooloptional, whether to generate a https-redirect or not, default false; requires SSL to be enabled
letsencryptbooloptional, whether to generate a Let's Encrypt certificate for this domain, default false; requiresSSL to be enabled
http2booloptional, whether to enable http/2 for this domain (requires to be enabled in the settings), default0 (false)
hsts_maxageintoptional max-age value for HSTS header
hsts_subbooloptional whether or not to add subdomains to the HSTS header
hsts_preloadbooloptional whether or not to preload HSTS header value
customeridintoptional, required when called as admin (if $loginname is not specified)
loginnamestringoptional, required when called as admin (if $customerid is not specified)

Response

string as json-encoded array

SubDomains.listing

lists all customer domain/subdomain entries

Permission

admin customer

Parameter

FieldTypeDescription
with_ipsbooloptional, default true
customeridintoptional, admin-only, select (sub)domains of a specific customer by id
loginnamestringoptional, admin-only, select (sub)domains of a specific customer by loginname
sql_searcharrayoptional array with index = fieldname, and value = array with 'op' => operator (one of <, > or =),LIKE is used if left empty and 'value' => searchvalue
sql_limitintoptional specify number of results to be returned
sql_offsetintoptional specify offset for resultset
sql_orderbyarrayoptional array with index = fieldname and value = ASC|DESC to order the resultset by one or morefields

Response

string as json-encoded array count|list

SubDomains.listingCount

returns the total number of accessible subdomain entries

Permission

admin customer

Parameter

FieldTypeDescription
customeridintoptional, admin-only, select (sub)domains of a specific customer by id
loginnamestringoptional, admin-only, select (sub)domains of a specific customer by loginname

Response

string as json-encoded response message

SubDomains.delete

delete a subdomain by either id or domainname

Permission

admin customer

Parameter

FieldTypeDescription
idintoptional, the domain-id
domainnamestringoptional, the domainname
customeridintoptional, required when called as admin (if $loginname is not specified)
loginnamestringoptional, required when called as admin (if $customerid is not specified)

Response

string as json-encoded array