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
accountIdstringrequiredacct_…).Query parameters
preflightDomainstringdnsSetupPreflight only for those zones. A key limited to single records never gets it.Example
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 } }}{ "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 } }, "dnsSetupPreflight": { "domain": "example.net", "usesHostupNameservers": true, "managedRecordsRead": true, "nameservers": [ "primary.ns.hostup.se", "secondary.ns.hostup.se" ], "hasThirdPartyWebsiteRecords": false, "hasThirdPartyMailRecords": true, "requiresChoice": true, "recommendedPreference": "website-only", "records": { "website": [], "mail": [ { "type": "MX", "name": "@", "value": "mx.example.org", "priority": 10 } ] }, "options": [ { "value": "full", "label": "Use web hosting for website and email", "description": "Website and email DNS can be pointed at this web hosting account.", "affects": [ "website", "mail" ], "recommended": false }, { "value": "email-only", "label": "Keep current website", "description": "Email can use this web hosting account while current website records stay unchanged.", "affects": [ "mail" ], "recommended": false }, { "value": "website-only", "label": "Keep current email", "description": "The website can use this web hosting account while current mail records stay unchanged.", "affects": [ "website" ], "recommended": true }, { "value": "none", "label": "Keep current DNS", "description": "Attach the domain to web hosting without changing existing website or email DNS.", "affects": [], "recommended": false } ] }}Response fields
domainsarray of objectdomainstringkindstringmain: 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 nullnull when the server reported none.countsobjectaddonintegerparkedintegersubintegerquotaobjectaddonobjectusedintegerlimitinteger or nullnull when there is no limit or it could not be read.remaininginteger or nullnull when limit is null.actionsobjectcanAddAddonobjectallowedbooleanreasonstring or nullcodestring or nulldnsSetupPreflightobjectpreflightDomain on a cPanel account. The current DNS of that domain and the setup choice adding it would need.domainstringusesHostupNameserversbooleantrue when the domain uses Hostup’s nameservers.managedRecordsReadbooleantrue 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.hasThirdPartyWebsiteRecordsbooleantrue when the website records point somewhere else.hasThirdPartyMailRecordsbooleantrue when the mail records point somewhere else. Also true when a null MX record says the domain takes no mail.requiresChoicebooleantrue when adding the domain needs dnsSetupPreference. Only a domain on Hostup’s nameservers can need it.recommendedPreferencestringfull, email-only, website-only, none.nameserversarray of stringrecordsobjectwebsitearray of objectwww.typestringnamestringvaluestringpriorityintegerrecordSubtypestringSPF or DKIM.mailarray of objectmail or autodiscover.typestringnamestringvaluestringpriorityintegerrecordSubtypestringSPF or DKIM.optionsarray of objectrecommended marks the suggested one.valuestringfull, email-only, website-only, none.labelstringdescriptionstringaffectsarray of stringrecommendedbooleanErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | preflightDomain is not a full domain name. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |