Delete an email account
DELETE /api/v2/shared-hosting/{accountId}/email-accounts/{address}
Deletes a mailbox and all mail stored in it from the web hosting account. This cannot be undone. {address} is the email address or the email account ID (mail_…). The mailbox domain must be on the account. An unknown mail_… ID returns 400 invalid_request. An account on Hostup’s previous hosting platform returns 409 account_not_eligible_cpanel.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredThe hosting account ID (
acct_…).addressstringrequiredThe email address (
hello@example.com) or the email account ID (mail_…). Unicode IDN and punycode spellings are both accepted.Example
curl -X DELETE "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/email-accounts/hello@example.com" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
204 The mailbox is deleted.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | {address} is not a valid email address or a known email account ID. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The mailbox domain is not on this hosting account (domain_not_owned), the API key lacks a required scope or the account is not active. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | The account is on Hostup’s previous hosting platform. Mailboxes cannot be deleted there through the API. |
| 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 | The server did not delete the mailbox (upstream_failed). This is also the answer when the domain is on the account but no mailbox has this address. Sending the same request again then fails the same way. Check the address with GET /api/v2/shared-hosting/{accountId}/email-accounts instead. |