Skip to content

Get email routing for a domain

GET /api/v2/shared-hosting/{accountId}/email-routing

Get how incoming mail is routed for one domain on a web hosting account. local delivers mail to mailboxes on this account. remote leaves it to an outside mail provider. secondary makes the account a backup mail server. auto lets the server pick from the domain’s MX records. The domain query takes the Unicode or punycode form. The response uses the Unicode form. Change the routing with PUT /api/v2/shared-hosting/{accountId}/email-routing.

Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes

Request

Path parameters

accountIdstringrequired
The web hosting account ID (acct_…).

Query parameters

domainstringrequired
The domain on the account, in Unicode or punycode form.

Example

GET /api/v2/shared-hosting/{accountId}/email-routing
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/email-routing?domain=example.com" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The routing for the domain.

Response 200
{
"id": "eroute_01hxa3b4c5d6e7f8g9h0j1k2m3",
"domain": "example.com",
"mode": "remote",
"detectedMode": null
}
Response fields
idstring
ID of this routing setting (eroute_…).
domainstring
The domain, in Unicode form.
modestring
How incoming mail for the domain is delivered. local: to mailboxes on this account. remote: to an outside mail provider. secondary: this account acts as a backup mail server. auto: the server picks from the domain’s MX records. One of auto, local, secondary, remote.
detectedModestring or null
The mode the server detected from the domain’s MX records, when it reports one. One of auto, local, secondary, remote.

Errors

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

400Invalid request. The response body is an RFC 7807 Problem Details document.
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.
409Conflict. code is account_suspended, account_not_eligible_cpanel.
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.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.