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 path parameter also for URLs
openbasedir_pathintoptional, either 0 for domains-docroot or 1 for customers-homedir
phpsettingidintoptional, php-settings-id, if empty the $domain value is used
redirectcodeintoptional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
sslenabledbooloptional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (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; requires SSL 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

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 path parameter also for URLs
selectserveraliasintoptional, 0 = wildcard, 1 = www-alias, 2 = none
isemaildomainbooloptional
openbasedir_pathintoptional, either 0 for domains-docroot or 1 for customers-homedir
phpsettingidintoptional, php-settings-id, if empty the $domain value is used
redirectcodeintoptional, redirect-code-id from TABLE_PANEL_REDIRECTCODES
sslenabledbooloptional, whether or not SSL is enabled for this domain, regardless of the assigned ssl-ips, default 1 (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; requires SSL to be enabled
http2booloptional, whether to enable http/2 for this domain (requires to be enabled in the settings), default 0 (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 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
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 more fields

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 array

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