Delete an email forwarding rule
DELETE /api/v2/domains/{id}/email-forwarding/{ruleId}
Deletes one forwarding rule on the domain. Mail sent to its address is no longer forwarded. A rule that still waits for its recipients to verify (pendingActivation: true) is cancelled the same way. This covers forwarding set up on the domain. Forwarders on a web hosting account are managed under /api/v2/shared-hosting/{accountId}/email-forwarders.
Authentication: An API key with the scopes write:email and write:domains. About keys and scopes
Request
Path parameters
idstringrequiredThe domain ID (
dom_…).ruleIdstringrequiredThe forwarding rule ID (
ef_…) from rules[].id on GET /api/v2/domains/{id}/email-forwarding.Example
curl -X DELETE "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/email-forwarding/dom_01hxa3b4c5d6e7f8g9h0j1k2m3" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
204 Rule deleted. No response body.
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 | The domain, the rule or the domain’s forwarding setup was not found. |
| 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 forwarding service did not confirm the deletion. Read the rule list before you retry. |