Skip to content

Delete a domain redirect

DELETE /api/v2/domains/{id}/redirects/{ruleId}

Deletes a URL redirect. Visitors are no longer forwarded. To pause a redirect without deleting it, send enabled: false with PATCH /api/v2/domains/{id}/redirects/{ruleId}. Deleting the last redirect of a domain removes the DNS records added for redirects. The records they replaced come back. A hostname that had none is left without a website record. rules[].removal on GET /api/v2/domains/{id}/redirects shows this before you delete. To remove a leftover rule found with include=orphans, pass its ID and add type=orphan.

Authentication: An API key with the scope write:domains. About keys and scopes

Request

Path parameters

idstringrequired
The domain ID (dom_…).
ruleIdstringrequired
The redirect ID (redir_…) from rules[].id. With type=orphan, the ID from orphanedProxyRules[].id.

Query parameters

typestring
orphan to delete a leftover rule returned by include=orphans. One of orphan.

Example

DELETE /api/v2/domains/{id}/redirects/{ruleId}
curl -X DELETE "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/redirects/redir_01hxa3b4c5d6e7f8g9h0j1k2m3" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

204 The redirect was deleted. No response body.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404The domain or the redirect was not found.
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.
502A leftover rule (type=orphan) could not be deleted right now.
503Redirects cannot be managed right now. Try again later.