Skip to content

List hosting domains

GET /api/v2/shared-hosting/{accountId}/domains

Lists every domain on the web hosting account in one array: the main domain, addon domains, parked domains and subdomains (kind). Check actions.canAddAddon before you add a domain with POST /api/v2/shared-hosting/{accountId}/domains. This read also works when the account is not active. On an account on Hostup’s previous hosting platform the list holds only the main domain and actions.canAddAddon.allowed is false. Set preflightDomain to see the current DNS of a domain you plan to add and which setup choice adding it would need. The preflight changes nothing.

Authentication: An API key with the scope read:hosting. Also console:services: on every request. Also read:dns: only when preflightDomain is set. About keys and scopes

Request

Path parameters

accountIdstringrequired
The hosting account ID (acct_…).

Query parameters

preflightDomainstring
Full domain name to check before you add it. A key limited to some DNS zones gets dnsSetupPreflight only for those zones. A key limited to single records never gets it.

Example

GET /api/v2/shared-hosting/{accountId}/domains
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/domains" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Domains on the account.

{
"domains": [
{
"domain": "example.com",
"kind": "main"
}
],
"mainDomain": "example.com",
"counts": {
"addon": 0,
"parked": 0,
"sub": 0
},
"quota": {
"addon": {
"used": 0,
"limit": 5,
"remaining": 5
}
},
"actions": {
"canAddAddon": {
"allowed": true,
"reason": null
}
}
}
Response fields
domainsarray of object
Every domain on the account.
domainstring
Domain name. IDNs are in Unicode form.
kindstring
main: the account’s main domain. addon: a domain with its own site. parked: an alias domain. sub: a subdomain. One of main, addon, parked, sub.
mainDomainstring or null
The account’s main domain. null when the server reported none.
countsobject
Number of addon domains, parked domains and subdomains.
addoninteger
parkedinteger
subinteger
quotaobject
Addon domains used and allowed by the plan.
addonobject
usedinteger
Addon domains on the account.
limitinteger or null
Addon domains the plan allows. null when there is no limit or it could not be read.
remaininginteger or null
Addon domains left. null when limit is null.
actionsobject
canAddAddonobject
Whether another addon domain can be added, with the reason when it cannot.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
dnsSetupPreflightobject
Only with preflightDomain on a cPanel account. The current DNS of that domain and the setup choice adding it would need.
domainstring
The domain checked.
usesHostupNameserversboolean
true when the domain uses Hostup’s nameservers.
managedRecordsReadboolean
true when the domain’s records in Hostup’s DNS were read. false means they could not be read. It does not mean the zone is empty.
hasThirdPartyWebsiteRecordsboolean
true when the website records point somewhere else.
hasThirdPartyMailRecordsboolean
true when the mail records point somewhere else. Also true when a null MX record says the domain takes no mail.
requiresChoiceboolean
true when adding the domain needs dnsSetupPreference. Only a domain on Hostup’s nameservers can need it.
recommendedPreferencestring
The choice that keeps the current services working. One of full, email-only, website-only, none.
nameserversarray of string
The domain’s current nameservers.
recordsobject
The website and mail records found.
websitearray of object
A, AAAA, CNAME and ALIAS records for the bare domain and www.
typestring
namestring
valuestring
priorityinteger
MX priority, when the record has one.
recordSubtypestring
What a TXT or SRV record is for, for example SPF or DKIM.
mailarray of object
MX records and the other records mail uses: SPF, DKIM and DMARC TXT records, Microsoft 365 SRV records and host names such as mail or autodiscover.
typestring
namestring
valuestring
priorityinteger
MX priority, when the record has one.
recordSubtypestring
What a TXT or SRV record is for, for example SPF or DKIM.
optionsarray of object
The four setup choices with a label and text for display. recommended marks the suggested one.
valuestring
One of full, email-only, website-only, none.
labelstring
descriptionstring
affectsarray of string
recommendedboolean

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400preflightDomain is not a full domain name.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.