Delete an email forwarder
DELETE /api/v2/shared-hosting/{accountId}/email-forwarders/{address}
Removes destinations from a forwarder on the web hosting account. It also removes discard addresses. {address} is the source address or the forwarder ID (efwd_…). Name the destinations to remove in destinations, in the JSON body or as a comma-separated query parameter. When you omit destinations, the API looks up the address in the forwarder list and removes the destinations of the first match. List the forwarders afterwards to check that none remain. For a discard address send action: discard in the body or as ?action=discard. Without destinations, an address that has no forwarder returns 400.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).addressstringrequiredinfo@example.com) or the forwarder ID (efwd_…). Unicode IDN and punycode spellings are both accepted.Query parameters
destinationsstringactionstringdiscard removes a discard address. Same as the body field. One of forward, discard.Body (optional)
actionstringdiscard removes a discard address. Leave out or use forward to remove destinations. One of forward, discard.destinationsarray of stringExample
curl -X DELETE "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/email-forwarders/user@example.com" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": "forward", "destinations": [ "anna@example.net" ] }'curl -X DELETE "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/email-forwarders/user@example.com" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "action": "discard" }'Responses
204 The destinations or the discard address are removed.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | {address} or the body is invalid. Also returned when no destinations were given and the address has no forwarder. |
| 401 | Unauthorized. Authentication is required. |
| 403 | The source 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. Forwarders cannot be managed 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 forwarder could not be changed on the server. |