Skip to content

Get the default address of a hosted domain

GET /api/v2/shared-hosting/{accountId}/email-default-address

Shows what happens to mail sent to an address on the domain that has no mailbox and no forwarder. action says it. main_account_inbox keeps the mail in the hosting account’s own inbox without a bounce. That inbox is not one of the mailboxes in GET /api/v2/shared-hosting/{accountId}/email-accounts. forward sends the mail to destinations. reject bounces it to the sender with rejectMessage. discard deletes it without a bounce. pipe hands it to a program on the account. The domain must be on the account (main, addon, parked or subdomain).

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

Request

Path parameters

accountIdstringrequired
The hosting account ID (acct_…).

Query parameters

domainstringrequired
Domain on the hosting account. Unicode IDN and punycode spellings are both accepted.

Example

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

Responses

200 The default address setting of the domain.

Response 200
{
"domain": "example.com",
"action": "main_account_inbox",
"destinations": [],
"rejectMessage": null
}
Response fields
domainstring
The domain. IDNs are in Unicode form.
actionstring
main_account_inbox: kept in the hosting account’s own inbox, no bounce. forward: sent to destinations. reject: refused with a bounce. discard: deleted, no bounce. pipe: handed to a program on the account. unknown: the setting could not be read or is none of these. One of main_account_inbox, forward, reject, discard, pipe, unknown.
destinationsarray of string
Target addresses when action is forward. Empty otherwise.
rejectMessagestring or null
Bounce text the sender gets when action is reject. null for other actions or when no text is set.

Errors

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

400domain is missing or not a valid domain name.
401Unauthorized. Authentication is required.
403The domain is not on this hosting account (domain_not_owned), the API key lacks a required scope or the account is not active.
404Not found. The resource does not exist or is not owned by the caller.
409The account is on Hostup’s previous hosting platform. The default address cannot be read there through the API.
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.