Update a CDN proxy rule
PATCH /api/v2/cdn/zones/{id}/proxy-rules/{ruleId}
Changes one proxy rule. Send only the fields you want to change. mode: "off" keeps the rule but sends the hostname’s traffic past the CDN. active: false stops applying the rule. name moves the rule to another hostname in the zone. Unknown fields return 400. The domain must be active.
Authentication: An API key with the scopes write:cdn and write:domains. About keys and scopes
Request
Path parameters
idstringrequiredThe CDN zone ID. From
GET /api/v2/cdn/zones.ruleIdstringrequiredThe CDN proxy rule ID. From
GET /api/v2/cdn/zones/{id}/proxy-rules.Body
modestringOne of
always, smart, off.namestringThe new hostname for the rule, in the same zone.
priorityinteger0 to 65535.
descriptionstring or nullactivebooleanExample
curl -X PATCH "https://cloud.hostup.se/api/v2/cdn/zones/cdn_01hxa3b4c5d6e7f8g9h0j1k2m3/proxy-rules/cprule_01hxa3b4c5d6e7f8g9h0j1k2m3" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "off", "description": "Temporarily bypass CDN proxying." }'curl -X PATCH "https://cloud.hostup.se/api/v2/cdn/zones/cdn_01hxa3b4c5d6e7f8g9h0j1k2m3/proxy-rules/cprule_01hxa3b4c5d6e7f8g9h0j1k2m3" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "priority": 200, "active": true }'Responses
200 The updated rule.
{ "id": "cprule_01hxa3b4c5d6e7f8g9h0j1k2m3", "fqdn": "www.example.com", "zone": "example.com", "proxy": { "enabled": false, "mode": "off", "priority": 100 }, "state": { "active": true, "reason": null }, "createdAt": "2026-04-27T12:00:00.000Z", "updatedAt": "2026-04-27T12:00:00.000Z", "description": "Temporarily bypass CDN proxying."}Response fields
idstringThe proxy rule ID (
cprule_…).fqdnstring or nullzonestring or nullproxyobjectenabledbooleanmodestringOne of
always, smart, off.priorityinteger0 to 65535.
stateobjectactivebooleanreasonstring or nullcreatedAtstring or nullupdatedAtstring or nulldescriptionstring or nullunchangedbooleanPresent and true only when POST found a rule for the same hostname and returned it instead of creating a second one.
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 | Not found. The resource does not exist or is not owned by the caller; code names the missing resource: cdn_zone_not_found, cdn_proxy_rule_not_found. |
| 409 | Conflict. code is account_suspended, or a route-specific blocker with its own recovery fields. |
| 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 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |