Skip to content

List domain redirects

GET /api/v2/domains/{id}/redirects

Lists the URL redirects on the domain, the limit per domain and whether another one can be created. Redirects are not DNS records. Create and change them through the redirect endpoints. A redirect only works while the domain uses Hostup’s nameservers. A rule shows status: "pending_dns" until then and while the DNS zone is being activated. When the caller also has write:domains, this read tries to repair rules with status: "error". Hostnames in the URLs are returned in Unicode form.

Authentication: An API key with the scope read:domains. Also write:domains: only for the automatic repair of rules with status: "error" during this read. Without it the list is returned unrepaired. About keys and scopes

Request

Path parameters

idstringrequired
The domain ID (dom_…).

Query parameters

includestring
orphans adds orphanedProxyRules: active redirect rules on the domain that have no saved redirect. One of orphans.

Example

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

Responses

200 The redirects, the limit per domain and whether another one can be created.

Response 200
{
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"rules": [
{
"id": "redir_01hxa3b4c5d6e7f8g9h0j1k2m3",
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"sourceHost": "www.example.com",
"sourcePath": null,
"sourceUrl": "https://www.example.com",
"targetUrl": "https://example.com",
"httpStatusCode": 301,
"scope": "exact",
"includeSubpaths": false,
"preservePath": false,
"preserveQuery": false,
"includeSubdomains": false,
"status": "active",
"reason": null,
"description": "Redirect www to apex",
"createdAt": "2026-04-27T12:00:00.000Z",
"updatedAt": "2026-04-27T12:00:00.000Z"
}
],
"limitPerDomain": 10,
"redirectCount": 1,
"actions": {
"canCreateNewRule": {
"allowed": true,
"reason": null
}
}
}
Response fields
domainIdstring
rulesarray of object
idstring
domainIdstring
sourceHoststring
The source host. An internationalised hostname is returned in Unicode, not punycode.
sourcePathstring or null
sourceUrlstring
The source URL. An internationalised hostname is returned in Unicode.
targetUrlstring
The target URL. An internationalised hostname is returned in Unicode.
httpStatusCodeinteger
One of 301, 302, 307, 308.
scopestring
One of exact, root_www, subdomains, all.
includeSubpathsboolean
Every page below the source address is redirected too, not only the source address itself.
preservePathboolean
Each matched page goes to the same path on the target. Only true together with includeSubpaths.
preserveQueryboolean
includeSubdomainsboolean
statusstring
One of active, pending_dns, error, disabled.
reasonstring or null
descriptionstring or null
createdAtstring or null
updatedAtstring or null
limitPerDomaininteger
redirectCountinteger
actionsobject
canCreateNewRuleobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
orphanedProxyRulesarray of object
Present only when you send include=orphans.

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.
404Not found. The resource does not exist or is not owned by the caller; code is domain_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.