Skip to content

Update CDN zone settings

PATCH /api/v2/cdn/zones/{id}

Changes CDN settings for one zone. Send only the groups and fields you want to change. A list such as waf.ipAllowlist or security.blockedCrawlers replaces the stored list. The response is the full zone, as returned by GET /api/v2/cdn/zones/{id}. The domain must be active. Otherwise the call returns 404 cdn_zone_not_found.

Set proxied to turn the CDN on or off. To challenge visitors outside Sweden, set waf.visitorProfileMode to challenge and geoRestriction.additionalCountries to ["SE"]. To let everyone in, set waf.visitorProfileMode to off. Sending geoRestriction.mode: "off" also clears the added countries.

To stop named crawlers before every other rule, verified bots included, send their ids in security.blockedCrawlers, for example gptbot or baiduspider. waf.uaBlocklist and waf.ipBlocklist block user-agent substrings and IP ranges the same way.

A body without any supported setting returns 400 invalid_request. So does an invalid block list entry, with one JSON pointer per entry in errors[]. Unknown fields are ignored when the body also has a supported setting.

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

Request

Path parameters

idstringrequired
The CDN zone ID. From GET /api/v2/cdn/zones.

Query parameters

includeRecordsboolean
Set to true to include the zone’s A, AAAA and CNAME records with their proxy state in the response. Default false. Default false.

Body

proxiedboolean
Turn the CDN proxy on or off for this zone.
securityobject
levelstring
One of off, low, medium, high.
sslModestring
One of off, flexible, full, strict.
alwaysUseHttpsboolean
minTlsVersionstring
One of 1.0, 1.1, 1.2, 1.3.
botProtectionboolean
blockBadCrawlersboolean
blockBadBotsboolean
wpLoginProtectionboolean
wpAdminChallengeboolean
blockedCrawlersarray of string
Replaces the blocked crawlers with these crawler catalogue IDs, in lowercase. Send [] to clear the list. An unknown ID returns invalid_request with errors[].code unknown_crawler_id. More than 50 IDs return too_many_crawlers.
performanceobject
earlyHintsboolean
alwaysOnlineboolean
cacheobject
purgeCacheboolean
wafobject
skipEnabledboolean
challengeGeoEnabledboolean
visitorProfileModestring
One of off, challenge, block.
ipAllowlistarray of string
uaAllowlistarray of string
pathAllowlistarray of string
uaBlocklistarray of string
Replaces the user-agent blocklist. Each entry is 3 to 80 characters: letters, digits, spaces and . _ / ( ) + : ; -. An entry that matches ordinary browser tokens returns invalid_request with errors[].code browser_user_agent_rejected.
ipBlocklistarray of string
Replaces the IP blocklist with IPv4 or IPv6 addresses or CIDR ranges. An invalid entry returns invalid_request with errors[].code invalid_ip.
geoRestrictionobject
modestring
One of off, whitelist.
additionalCountriesarray of string
ISO country codes, in capitals, to allow on top of the countries that are always allowed.

Example

PATCH /api/v2/cdn/zones/{id}
curl -X PATCH "https://cloud.hostup.se/api/v2/cdn/zones/cdn_01hxa3b4c5d6e7f8g9h0j1k2m3" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"proxied": true,
"waf": {
"visitorProfileMode": "challenge"
},
"geoRestriction": {
"mode": "whitelist",
"additionalCountries": [
"SE"
]
}
}'

Responses

200 The zone with the new settings.

Response 200
{
"id": "cdn_01hxa3b4c5d6e7f8g9h0j1k2m3",
"domain": "example.com",
"domainId": "dom_01hxa3b4c5d6e7f8g9h0j1k2m3",
"status": "active",
"reason": null,
"proxied": true,
"securityLevel": "medium",
"ssl": {
"status": "active",
"expiresAt": "2026-08-01T00:00:00.000Z"
},
"ruleCount": 2,
"security": {
"level": "medium",
"sslMode": "full",
"alwaysUseHttps": true,
"minTlsVersion": "1.2",
"botProtection": true,
"blockBadCrawlers": true,
"blockBadBots": true,
"wpLoginProtection": true,
"wpAdminChallenge": true,
"blockedCrawlers": []
},
"performance": {
"earlyHints": true,
"alwaysOnline": true
},
"cache": {
"purgeCache": false
},
"waf": {
"skipEnabled": false,
"challengeGeoEnabled": true,
"visitorProfileMode": "challenge",
"ipAllowlist": [
"198.51.100.10"
],
"uaAllowlist": [
"ExampleMonitor/1.0"
],
"pathAllowlist": [
"/health"
],
"uaBlocklist": [],
"ipBlocklist": []
},
"geoRestriction": {
"enabled": true,
"whitelistCountries": [
"SE"
],
"mode": "whitelist",
"standardCountries": [],
"additionalCountries": [
"SE"
],
"combinedCountries": [
"SE"
]
},
"activity": {
"lastChangeDetectedAt": "2026-04-27T12:00:00.000Z",
"lastCheckedAt": "2026-04-27T12:00:00.000Z",
"settingsUpdatedAt": "2026-04-27T12:00:00.000Z"
},
"actions": {
"canEnableProxy": {
"allowed": true,
"reason": null
},
"canIssueCertificate": {
"allowed": true,
"reason": null
},
"canChangeMode": {
"allowed": true,
"reason": null
},
"canActivate": {
"allowed": false,
"reason": "CDN is already active for this domain."
},
"canDeactivate": {
"allowed": true,
"reason": null
},
"canPreparePartial": {
"allowed": true,
"reason": null
},
"canCheckPartial": {
"allowed": false,
"reason": "Prepare external DNS setup first."
},
"canPrepareNameservers": {
"allowed": false,
"reason": "Hostup's nameservers already answer for this domain."
}
},
"records": null,
"setup": {
"mode": "full",
"status": "active",
"reason": null,
"verification": null,
"routing": [],
"certificate": {
"status": "active",
"hosts": [
"example.com",
"www.example.com"
]
},
"checkedAt": "2026-04-27T12:00:00.000Z",
"currentNameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
],
"expectedNameservers": [
"primary.ns.hostup.se",
"secondary.ns.hostup.se"
],
"registrarRelation": "hostup",
"nameserverManagementUrl": "/domains/example.com?tab=nameservers"
}
}
Response fields
setupobject
How the CDN is set up for the zone: with Hostup’s nameservers or with your own DNS. Read status and reason as returned. A prepared partial setup is not active until the verification, the routing and the HTTPS certificate are confirmed. Copy the DNS names and values as returned. Don’t build them yourself.
modestring
full: the domain uses Hostup’s nameservers. partial: your own DNS stays authoritative and chosen hostnames are routed through the CDN. currentNameservers shows the nameservers seen now. One of full, partial, unknown.
statusstring
Overall readiness. A pending_… status names the next setup step. unavailable means the state could not be read. It does not mean that DNS or the certificate is wrong. One of not_configured, pending_verification, pending_routing, pending_certificate, active, unavailable.
reasonstring or null
The setup state in words. Null when nothing needs explaining.
verificationobject or null
The TXT record that proves ownership, to publish at your DNS provider. Null when none is needed or available. Copy the name and value exactly.
routingarray of object
The chosen hostnames with the origin values kept when the setup was prepared. Each row has the DNS change it needs at your DNS provider. Publish the routing record without other, conflicting record types at the same name. A row with status: unsupported is not set up.
hostnamestring
currentOriginarray of object
typestring
One of A, AAAA, CNAME.
valuestring
recordobject or null
The exact routing record to publish at your DNS provider. Null when none is available. Use ALIAS only when your provider supports a flattened alias at the zone apex. Don’t replace an apex with a plain CNAME when that conflicts with the other records at the apex.
statusstring
One of pending, verified, unsupported, unknown.
reasonstring or null
certificateobject
statusstring
One of active, pending, error, unknown.
hostsarray of string
Hostnames on the CDN’s HTTPS certificate.
checkedAtstring or null
When the setup was last checked, in UTC. Null when unknown.
currentNameserversarray of string
expectedNameserversarray of string
Hostup’s nameservers, for a full setup. A partial setup does not need them.
registrarRelationstring
Where the registration of the domain is managed. It does not depend on the CDN setup mode. One of hostup, external, unknown.
nameserverManagementUrlstring or null
Link to change the nameservers in the client area, when the domain is registered with Hostup. Otherwise null. To use Hostup’s nameservers then, set expectedNameservers at your registrar.
idstring or null
The CDN zone ID (cdn_…). Set even before the CDN is set up. Null only when the zone cannot be identified.
domainstring
domainIdstring or null
The domain ID (dom_…) for a domain registered with Hostup. null for a DNS-only zone.
statusstring
One of active, pending, misconfigured, missing, disabled.
reasonstring or null
proxiedboolean
securityLevelstring
One of off, low, medium, high.
sslobject
statusstring
One of active, pending, error.
expiresAtstring or null
ruleCountinteger
securityobject
levelstring
Overall CDN security level. One of off, low, medium, high.
sslModestring
The TLS mode between visitors, the CDN and your origin server. One of off, flexible, full, strict.
alwaysUseHttpsboolean
minTlsVersionstring
One of 1.0, 1.1, 1.2, 1.3.
botProtectionboolean
blockBadCrawlersboolean
blockBadBotsboolean
wpLoginProtectionboolean
Protect the WordPress login pages.
wpAdminChallengeboolean
Challenge requests to the WordPress admin paths.
blockedCrawlersarray of string
Crawler catalogue IDs that are blocked before every other rule, verified-bot exemptions included. Examples: baiduspider, gptbot, claudebot, ahrefsbot. Lowercase IDs only. The crawler catalogue has the full list. Empty unless crawlers were chosen. Separate from blockBadCrawlers, the general check for bad crawlers.
performanceobject
earlyHintsboolean
alwaysOnlineboolean
cacheobject
purgeCacheboolean
The saved cache-purge setting.
wafobject
skipEnabledboolean
Whether your own WAF skip rules are on.
challengeGeoEnabledboolean
Whether the country challenge of the visitor profile is on.
visitorProfileModestring
challenge: visitors from outside the allowed countries must pass a challenge. block: they are blocked. off: the visitor profile does nothing. One of off, challenge, block.
ipAllowlistarray of string
IP addresses or CIDR ranges that skip the custom WAF checks.
uaAllowlistarray of string
User-agent substrings that skip the custom WAF checks.
pathAllowlistarray of string
Path prefixes that skip the custom WAF checks.
uaBlocklistarray of string
User-agent substrings that are blocked before every allowlist and verified-bot exemption. Entries equal to or contained in ordinary browser tokens, such as Mozilla, Chrome or bot, are rejected with invalid_request. They would block ordinary visitors.
ipBlocklistarray of string
IPv4 or IPv6 addresses or CIDR ranges that are blocked before every allowlist and verified-bot exemption.
geoRestrictionobject
enabledboolean
whitelistCountriesarray of string
Older field with the allowed country codes, in capitals. Use combinedCountries instead.
modestring
off: no country limit. whitelist: only the countries in combinedCountries are allowed. One of off, whitelist.
standardCountriesarray of string
Countries that are always allowed. You cannot remove them.
additionalCountriesarray of string
Country codes you added on top of standardCountries.
combinedCountriesarray of string
The allowed countries: standardCountries plus additionalCountries.
activityobject
lastChangeDetectedAtstring or null
lastCheckedAtstring or null
settingsUpdatedAtstring or null
actionsobject
canEnableProxyobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canIssueCertificateobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canChangeModeobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canActivateobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canDeactivateobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canPreparePartialobject
Whether you can prepare a setup with your own DNS. The request also checks the current delegation. A full setup that is delegated now cannot be converted with this action.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canCheckPartialobject
Whether an existing partial setup can be checked now.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canPrepareNameserversobject
Whether the zone still has to be published on Hostup’s nameservers before you switch the domain to them. Allowed while it is not published there. Then send prepare_nameservers to POST /api/v2/cdn/zones/{id}. Read the zone until this gate closes. Only then change the nameservers. Not allowed when the zone is already published, when it uses your own DNS or when readiness was not checked.
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
recordsarray of any or null
null unless you send includeRecords=true.

Errors

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

400The body is not a JSON object, has no supported setting or has an invalid block list entry. The CDN can also refuse the settings.
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 cdn_zone_not_found.
409Conflict. code is account_suspended, or a route-specific blocker with its own recovery fields.
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.
502Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists.