Change forwarding rule recipients
PATCH /api/v2/domains/{id}/email-forwarding/{ruleId}
Replaces the recipient list of one forwarding rule. The forwarding address itself cannot change. To use another address, delete the rule and create a new one with POST /api/v2/domains/{id}/email-forwarding. A new recipient address gets a verification e-mail. While any recipient in the list is unverified, nothing changes and createOutcome.status is verification_required. Send the same request again once every recipient has verified. To send a recipient the e-mail again, use POST /api/v2/domains/{id}/email-forwarding/destinations/{destinationId}/verification. Returns the domain’s forwarding settings with the updated rule.
Authentication: An API key with the scopes write:email and write:domains. About keys and scopes
Request
Path parameters
idstringrequireddom_…).ruleIdstringrequiredef_…) from rules[].id on GET /api/v2/domains/{id}/email-forwarding.Body
destinationsarray of stringrequiredExample
curl -X PATCH "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/email-forwarding/dom_01hxa3b4c5d6e7f8g9h0j1k2m3" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "destinations": [ ] }'Responses
200 The change was saved or a new recipient must verify first (createOutcome.status). The body is the domain’s forwarding settings.
{ "enabled": true, "integrationStatus": "enabled", "reason": null, "maxRules": 200, "ruleCount": 1, "rules": [ { "id": "ef_01hxa3b4c5d6e7f8g9h0j1k2m3", "destinations": [ ], "editable": true, "isEnabled": true, "name": "hello", "priority": 0 } ], "destinations": [ { "id": "efd_01hxa3b4c5d6e7f8g9h0j1k2m3", "verificationStatus": "verified", "createdAt": "2026-04-27T12:00:00.000Z", "verifiedAt": "2026-04-27T12:05:00.000Z" }, { "id": "efd_01hxb4c5d6e7f8g9h0j1k2m3n4", "verificationStatus": "verified", "createdAt": "2026-04-27T12:00:00.000Z", "verifiedAt": "2026-04-27T12:06:00.000Z" } ], "catchAll": { "action": "disabled", "destination": null }, "existingMxRecords": [], "dnsActivation": { "status": "active", "reason": null, "checkedAt": "2026-04-27T12:05:00.000Z" }, "actions": { "canCreateNewRule": { "allowed": true, "reason": null }, "canSetCatchAll": { "allowed": true, "reason": null } }, "createOutcome": { "status": "completed", "reason": null, "createdRuleCount": 0, "createdRules": [] }}{ "enabled": true, "integrationStatus": "enabled", "reason": null, "maxRules": 200, "ruleCount": 1, "rules": [ { "id": "ef_01hxa3b4c5d6e7f8g9h0j1k2m3", "destinations": [ ], "editable": true, "isEnabled": true, "name": "hello", "priority": 0 } ], "destinations": [ { "id": "efd_01hxa3b4c5d6e7f8g9h0j1k2m3", "verificationStatus": "verified", "createdAt": "2026-04-27T12:00:00.000Z", "verifiedAt": "2026-04-27T12:05:00.000Z" }, { "id": "efd_01hxb4c5d6e7f8g9h0j1k2m3n4", "verificationStatus": "unverified", "createdAt": "2026-04-27T12:10:00.000Z", "verifiedAt": null } ], "catchAll": { "action": "disabled", "destination": null }, "existingMxRecords": [], "dnsActivation": { "status": "active", "reason": null, "checkedAt": "2026-04-27T12:05:00.000Z" }, "actions": { "canCreateNewRule": { "allowed": true, "reason": null }, "canSetCatchAll": { "allowed": true, "reason": null } }, "createOutcome": { "status": "verification_required", "reason": "Verify the new recipients, then save again. Existing forwarding remains unchanged.", "createdRuleCount": 0, "createdRules": [], "destinationsNeedingVerification": [ ], "verificationEmailsSent": [ ] }}Response fields
enabledbooleanintegrationStatusstringenabled, disabled, unavailable.reasonstring or nullmaxRulesintegerruleCountintegerrulesarray of objectidstringemailstringdestinationstringisEnabledbooleannamestring or nullpriorityintegerdestinationsarray of objectidstringemailstringverificationStatusstringverified, pending, unverified.createdAtstring or nullverifiedAtstring or nullcatchAllobject | nullactionstringforward, drop, disabled.destinationstring or nullexistingMxRecordsarray of objecttypestringMX.valuestringpriorityinteger or nulldnsActivationobjectactive: forwarding can be turned on now. activating: the domain already uses our nameservers and the zone is being activated. Reading this resource starts the check. Poll until active, usually a few minutes. not_delegated: the domain uses other nameservers. unavailable: there is no zone at Hostup or its state could not be read.statusstringactive, activating, not_delegated, unavailable.reasonstring or nullcheckedAtstringactionsobjectcanCreateNewRuleobjectallowedbooleanreasonstring or nullcodestring or nullcanSetCatchAllobjectallowedbooleanreasonstring or nullcodestring or nullcreateOutcomeobjectcreatedRuleCountintegercreatedRulesarray of objectidstringemailstringdestinationstringisEnabledbooleannamestring or nullpriorityintegerErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The body has a field other than destinations, a recipient is invalid or the recipients would forward mail in a loop (email_forwarding_loop). |
| 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. |
| 409 | email_forwarding_not_editable: the rule was set up outside the forwarding settings (rules[].editable is false). email_forwarding_busy: another forwarding change on the domain is still running. |
| 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 change. Read the rule list before you retry. |