Skip to content

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

accountIdstringrequired
The hosting account ID (acct_…).
addressstringrequired
The source address (info@example.com) or the forwarder ID (efwd_…). Unicode IDN and punycode spellings are both accepted.

Query parameters

destinationsstring
Destinations to remove, comma-separated. Use it when your client cannot send a body with DELETE. Omit it to remove the destinations the forwarder has.
actionstring
discard removes a discard address. Same as the body field. One of forward, discard.

Body (optional)

actionstring
discard removes a discard address. Leave out or use forward to remove destinations. One of forward, discard.
destinationsarray of string
Destinations to remove. Omit them to remove the destinations the forwarder has.

Example

DELETE /api/v2/shared-hosting/{accountId}/email-forwarders/{address}
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"
]
}'

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.
401Unauthorized. Authentication is required.
403The source 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. Forwarders cannot be managed 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.
502The forwarder could not be changed on the server.