/api/v2/shared-hosting/{accountId}/actions/change-main-domain Return whether the main (primary) domain of a shared-hosting account can be changed, and what the change would do.
Get accountId from GET /api/v2/shared-hosting data[].id.
Without domain the response covers the account only: available / reason, the current mainDomain, the other domains attached, and the mailboxes on the main domain.
With domain it also evaluates that target (target.available / target.reason), lists how each mailbox address changes, and includes the target's DNS preflight; supplying domain additionally requires the read:dns scope.
The main domain can be changed to a domain from outside the account while it is the only domain on the account.
An addon domain that is already on the account can take over as main domain when every other domain on the account is that addon domain or one of its subdomains: promotableDomains names it, and its evaluation carries target.promotion.
Any other mix of attached domains returns available: false.
A domain registered with HostUp, or with a DNS zone at HostUp, must be on the caller's own account (or covered by its owner's DNS delegation approval).
Nothing is changed by this request.
read:hostingconsole:services
Authenticate with an API key in the Authorization: Bearer <token> header.
accountId string required
Example: acct_01hxa3b4c5d6e7f8g9h0j1k2m3 Public shared-hosting account ID. Get it from GET /api/v2/shared-hosting data[].id. Do not invent this value; use the exact ID returned by the referenced API response.
domain string
· Example: example.net The domain to evaluate as the new main domain, without www.. Adds the read:dns scope requirement; does not change anything.
Authorization Bearer <token> Accept application/json domain was supplied, the evaluation of that target. 8 fields available boolean required Whether the main domain of this account can be changed through the API right now.
reason string · nullable required
· Example: null Why the change is unavailable. null when available is true.
mainDomain string · nullable required
· Example: example.com The account's current main domain.
otherDomains array<string> required Every other domain attached to the account (addon domains, aliases and subdomains). When this list is not empty, only a domain in promotableDomains can become the main domain.
promotableDomains array<string> required
· Example: [] Addon domains on the account that can take over as main domain: every other attached domain is that addon domain or one of its subdomains. Empty when the account has no such domain.
emailAccounts array<any> · nullable required Mailboxes on the current main domain. These get addresses on the new main domain. null when the mailboxes could not be read.
actions object required actions.canKeepPreviousDomain object required Whether keepPreviousDomain: true can be used on POST. Keeping the previous domain attaches it to the same website folder and uses one addon domain slot on the plan.
actions.canKeepPreviousDomain.allowed boolean required
· Example: true actions.canKeepPreviousDomain.reason string · nullable required
· Example: null Nullable: may be null when not applicable.
actions.canKeepPreviousDomain.code string · nullable
· Example: pending_order Machine-readable reason code when an action is blocked.
target object · nullable required Evaluation of the domain query parameter. null when no domain was supplied.
domain is not a full domain name, or starts with www.. 10 fields type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object code is account_not_eligible_cpanel. 10 fields type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object Retry-After seconds plus X-RateLimit-* headers. 10 fields type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object type string
· Example: https://developer.hostup.se/errors/invalid_request title string
· Example: Validation failed status integer
· Example: 400 detail string
· Example: The request body failed validation. code string
· Example: invalid_request Stable machine-readable code. Branch on this field, not on detail.
instance string
· Example: /api/v2/orders requestId string
· Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3 timestamp string
· Example: 2026-04-27T12:34:56.000Z errors array<object> Field-level validation errors when code is invalid_request.
errors[].pointer string required
· Example: /items/0/eppCode errors[].detail string required
· Example: `eppCode` is required for this transfer. errors[].code string required
· Example: missing_required extensions object https://cloud.hostup.se/api/v2/shared-hosting/{accountId}/actions/change-main-domain curl -X GET "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/change-main-domain" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" // The target can become the main domain
{
"available": true,
"reason": null,
"mainDomain": "example.com",
"otherDomains": [],
"promotableDomains": [],
"emailAccounts": [
"[email protected]"
],
"actions": {
"canKeepPreviousDomain": {
"allowed": true,
"reason": null
}
},
"target": {
"domain": "example.net",
"available": true,
"reason": null,
"emailAccountChanges": [
{
"current": "[email protected]",
"afterChange": "[email protected]"
}
],
"dnsSetup": {
"usesHostupNameservers": true,
"managedRecordsRead": true,
"nameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
],
"hasThirdPartyWebsiteRecords": false,
"hasThirdPartyMailRecords": false,
"requiresChoice": false,
"recommendedPreference": "full",
"records": {
"website": [],
"mail": []
},
"options": []
},
"promotion": null
}
}
// Other domains are attached that would not follow the change
{
"available": false,
"reason": "The hosting account has other domains attached, so the main domain cannot be changed here. Contact support and we will change it for you.",
"mainDomain": "example.com",
"otherDomains": [
"blog.example.com",
"shop.example.net"
],
"promotableDomains": [],
"emailAccounts": [
"[email protected]"
],
"actions": {
"canKeepPreviousDomain": {
"allowed": false,
"reason": "The hosting account has other domains attached, so the main domain cannot be changed here. Contact support and we will change it for you."
}
},
"target": null
}
// An addon domain on the account can take over as main domain
{
"available": true,
"reason": null,
"mainDomain": "example.com",
"otherDomains": [
"example.net",
"shop.example.net"
],
"promotableDomains": [
"example.net"
],
"emailAccounts": [],
"actions": {
"canKeepPreviousDomain": {
"allowed": true,
"reason": null
}
},
"target": {
"domain": "example.net",
"available": true,
"reason": null,
"emailAccountChanges": [],
"dnsSetup": null,
"promotion": {
"siteFolder": "example.net",
"previousSiteFolder": "example.com",
"subdomains": [
"shop.example.net"
],
"ftpAccounts": []
}
}
}