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
accountIdstringrequiredThe web hosting account ID (
acct_…).Query parameters
domainstringrequiredThe domain on the account, in Unicode or punycode form.
Example
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.
{ "id": "eroute_01hxa3b4c5d6e7f8g9h0j1k2m3", "domain": "example.com", "mode": "remote", "detectedMode": null}Response fields
idstringID of this routing setting (
eroute_…).domainstringThe domain, in Unicode form.
modestringHow 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 nullThe 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.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 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. |
| 409 | Conflict. code is account_suspended, account_not_eligible_cpanel. |
| 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. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |