Update domain redirect

Partially update a saved URL redirect rule. Get {id} from GET /api/v2/domains data[].id and {ruleId} from GET /api/v2/domains/{id}/redirects rules[].id. All request fields are optional, but at least one meaningful field should be sent. If sourceUrl is changed, its host must still belong to the same domain. Use enabled: false to pause a redirect without deleting it; use DELETE only when the rule should be removed.

Domains & DNS Redirects

Authentication

Required API scope: write:domains

Use Authorization: Bearer <token> for API keys. Dashboard sessions may also use hostup_session.

Context

Path Parameters

id string required Example: dom_01hxa3b4c5d6e7f8g9h0j1k2m3

Public domain ID from `GET /api/v2/domains` `data[].id`. Do not invent this value; use the exact ID returned by the referenced API response.

ruleId string required Example: redir_01hxa3b4c5d6e7f8g9h0j1k2m3

Public redirect rule ID from `GET /api/v2/domains/{id}/redirects` `rules[].id`. Do not invent this value; use the exact ID returned by the referenced API response.

Headers

Accept Example
Content-Type Example

Body

required
application/json
sourceUrl string · Example: https://www.example.com
targetUrl string · Example: https://example.com
httpStatusCode integer · enum · Example: 302
301
302
307
308
scope string · enum · Example: exact
exact
root_www
subdomains
all
preserveQuery boolean · Example: true
includeSubdomains boolean · Example: false
preservePath boolean · Example: true
description stringnull · Example: Temporary campaign redirect
enabled boolean · Example: false

Responses

200 Updated redirect rule.
id string · Example: redir_01hxa3b4c5d6e7f8g9h0j1k2m3
domainId string · Example: dom_01hxa3b4c5d6e7f8g9h0j1k2m3
sourceHost string · Example: www.example.com
sourcePath stringnull · Example: null
sourceUrl string · Example: https://www.example.com
targetUrl string · Example: https://example.com
httpStatusCode integer · enum · Example: 301
301
302
307
308
scope string · enum · Example: root_www
exact
root_www
subdomains
all
preservePath boolean · Example: false
preserveQuery boolean · Example: false
includeSubdomains boolean · Example: false
status string · enum · Example: active
active
pending_dns
error
disabled
reason stringnull · Example: null
description stringnull · Example: Redirect www to apex
createdAt stringnull · Example: 2026-04-27T12:00:00.000Z
updatedAt stringnull · Example: 2026-04-27T12:00:00.000Z
400 Invalid request. The response body is an RFC 7807 Problem Details document.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
401 Unauthorized. Authentication is required.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
403 Forbidden. The caller lacks a required scope or does not own the resource.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
404 Not found. The resource does not exist or is not owned by the caller.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
429 Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
500 Internal error. Retry later or contact support if the issue persists.
type string · Example: https://developer.hostup.se/errors/invalid_request
title string · Example: Validation failed
status integer · Example: 400
detail string · Example: The request body failed validation.
code string · Example: invalid_request

Stable machine-readable code. Branch on this field, not on `detail`.

instance string · Example: /api/v2/orders
requestId string · Example: req_01hxa3b4c5d6e7f8g9h0j1k2m3
timestamp string · Example: 2026-04-27T12:34:56.000Z
errors array<object>

Field-level validation errors when `code` is `invalid_request`.

errors[].pointer string required · Example: /items/0/eppCode
errors[].detail string required · Example: `eppCode` is required for this transfer.
errors[].code string required · Example: missing_required
extensions object
PATCH https://cloud.hostup.se/api/v2/domains/{id}/redirects/{ruleId}
For AI assistants
View as Markdown
cURL
curl -X PATCH "https://cloud.hostup.se/api/v2/domains/dom_01hxa3b4c5d6e7f8g9h0j1k2m3/redirects/redir_01hxa3b4c5d6e7f8g9h0j1k2m3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "targetUrl": "https://example.com/new-home",
    "httpStatusCode": 302
  }'
Response
{
  "id": "redir_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "sourceHost": "www.example.com",
  "sourcePath": null,
  "sourceUrl": "https://www.example.com",
  "targetUrl": "https://example.com/new-home",
  "httpStatusCode": 302,
  "scope": "root_www",
  "preservePath": false,
  "preserveQuery": false,
  "includeSubdomains": false,
  "status": "active",
  "reason": null,
  "description": "Temporary campaign redirect",
  "createdAt": "2026-04-27T12:00:00.000Z",
  "updatedAt": "2026-04-27T12:30:00.000Z"
}
Request Body Change target URL
{
  "targetUrl": "https://example.com/new-home",
  "httpStatusCode": 302
}