/api/v2/shared-hosting/{accountId}/actions/change-main-domain Change the main (primary) domain of a cPanel-backed shared-hosting account.
Get accountId from GET /api/v2/shared-hosting data[].id, and check the change first with GET on this path.
The control-panel username, files and databases stay as they are: the same website folder is served on the new domain, and mailboxes on the previous main domain get addresses on the new one.
The previous domain is detached unless keepPreviousDomain is true, which attaches it again to the same website folder without changing its DNS.
No domain registration is cancelled, renewed or transferred.
If the new domain is delegated to HostUp's nameservers and has no website or email records elsewhere, its DNS is pointed to the hosting account; if it has such records, the request is refused with dns_setup_choice_required until dnsSetupPreference is supplied.
A domain that is an addon domain on the account today (see promotableDomains on GET) can take over as main domain: its website folder becomes public_html, the previous main domain's website files are kept in a folder named after that domain, its subdomains, mailboxes, certificate and DKIM key are kept, its DNS is not changed, and promotion in the response says what was put back; the website can be unreachable for a couple of minutes while the web server switches over.
The change can take up to a minute, longer for an addon domain with several subdomains.
The request is safe to repeat: a request for a domain that is already the main domain completes whatever an interrupted earlier request left undone and returns 200 with changed: false.
write: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.
Authorization Bearer <token> Accept application/json Content-Type application/json domain string required
· Example: example.net The new main domain, without www. (the www name is attached automatically). It must be a registered domain (not a subdomain) with public nameservers, must not be attached to any hosting account, and, when it is registered with HostUp or has a DNS zone at HostUp, must be on the caller's own account.
keepPreviousDomain boolean Keep the previous main domain attached to the same website folder so it keeps showing the site. Uses one addon domain slot; see actions.canKeepPreviousDomain on GET. The previous domain's DNS is not changed, and its old mailbox addresses are not recreated.
dnsSetupPreference string · enum What to point at the hosting account for the NEW domain when it already has records elsewhere: full = website and email, website-only = website (existing email records are kept), email-only = email (existing website records are kept), none = change no DNS. Required when GET reports target.dnsSetup.requiresChoice.
full email-only website-only none mainDomain string required
· Example: example.net previousMainDomain string · nullable required
· Example: example.com The main domain before the change. null when the requested domain was already the main domain and nothing remained to finish.
changed boolean required True when this request changed the main domain. False when it was already in place and only remaining steps were completed.
emailAccounts array<any> · nullable required Mailboxes on the new main domain after the change. null when they could not be read.
previousDomain object · nullable required What happened to the previous main domain. null when previousMainDomain is null.
certificate object required certificate.status string · enum required requested = issuance of an SSL certificate for the new domain was started and normally completes within minutes. request_failed = it could not be started now and is issued at the next automatic check.
requested request_failed dns object · nullable required DNS handling for the new main domain. null when the domain was already the main domain or its DNS could not be inspected.
promotion object · nullable required Outcome of the parts an addon-domain-to-main-domain change puts back. null when the new main domain was not an addon domain on the account, and on a repeated request for a domain that is already the main domain.
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 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 mainDomainChanged: true means the main domain was changed and only the final step is missing; repeat the request to finish it. For an addon domain, a change that stopped part-way and could not be put back automatically is reported here with a detail asking to contact support. 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 https://cloud.hostup.se/api/v2/shared-hosting/{accountId}/actions/change-main-domain curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/change-main-domain" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"domain": "example.net"
}' {
"mainDomain": "example.net",
"previousMainDomain": "example.com",
"changed": true,
"emailAccounts": [
"[email protected]"
],
"previousDomain": {
"domain": "example.com",
"status": "detached",
"reason": null
},
"certificate": {
"status": "requested"
},
"dns": {
"usesHostupNameservers": true,
"appliedPreference": "full"
},
"promotion": null
} {
"domain": "example.net"
}