Skip to content

Update a zone

PATCH
/api/zones/{id}

Partially updates a zone and its settings. name + tag must remain unique within the organization. When logForwardingEnabled is true, logForwardingHostname, logForwardingPort, logForwardingProtocol and logForwardingFormat are all required. A defaultBackend must reference an origin server or load balancer that belongs to the same organization.

Authorizations

ApiToken

Long-lived API token created via POST /api/api-tokens (returned once in plaintext).

Type
API Key (header: X-API-TOKEN)
or
JWT

JWT access token obtained via POST /api/auth/login. Send as: Authorization: Bearer .

Type
HTTP (bearer)

Parameters

Path Parameters

id*

Zone identifier

Type
string
Required

Request Body

application/merge-patch+json
JSON
{
  
"organization": "/api/organizations/1",
  
"name": "my-website",
  
"tag": "prod",
  
"enabled": true,
  
"defaultBackend": {
  
  
"type": "string",
  
  
"id": "string"
  
},
  
"cachingDynamicEnabled": false,
  
"cachingRespectCacheControl": true,
  
"cachingDynamicCacheKey": {
  
  
"varyByHostname": true,
  
  
"varyByCookie": [
  
  
]
  
},
  
"cachingStaticEnabled": false,
  
"cachingStaticCacheKey": {
  
  
"varyByHostname": true,
  
  
"varyByQueryString": [
  
  
]
  
},
  
"cachingDefaultTtl": 604800,
  
"cachingIgnoredUrlParams": [
  
],
  
"cachingIgnoredCacheTags": [
  
],
  
"cachingCustomCacheTagHeaders": [
  
  
{
  
  
  
"header": "string",
  
  
  
"delimiter": "string"
  
  
}
  
],
  
"debugHeadersEnabled": false,
  
"processingSsi": false,
  
"processingEsi": false,
  
"underAttack": false,
  
"customPagesErrorEnabled": false,
  
"customPagesMaintenanceActive": false,
  
"customPagesSecurityEnabled": false,
  
"customPagesChallengeEnabled": false,
  
"basicAuthEnabled": false,
  
"basicAuthUsers": [
  
  
{
  
  
  
"id": "9f8b2c1a-4d3e-4f5a-8b6c-7d8e9f0a1b2c",
  
  
  
"username": "jdoe"
  
  
}
  
],
  
"securityEnabled": true,
  
"imageOptimizationEnabled": true,
  
"imageOptimizationWebpEnabled": true,
  
"imageOptimizationAvifEnabled": true,
  
"imageOptimizationAvifQuality": 50,
  
"imageOptimizationWebpQuality": 50,
  
"imageOptimizationJpegQualityTarget": 0.9997,
  
"imageOptimizationJpegEnabled": false,
  
"imageOptimizationJpegQualityMin": 40,
  
"imageOptimizationJpegQualityMax": 98,
  
"imageOptimizationPngEnabled": false,
  
"imageOptimizationPngQualityMin": 40,
  
"imageOptimizationPngQualityMax": 98,
  
"minifyHtml": false,
  
"staleCacheWhileOffline": false,
  
"staleCacheWhileUpdating": false,
  
"cacheErrorResponse": false,
  
"logForwardingEnabled": false,
  
"logForwardingHostname": "logs.example.com",
  
"logForwardingPort": 514,
  
"logForwardingToken": "abc123def456",
  
"logForwardingProtocol": "tcp",
  
"logForwardingFormat": "json",
  
"headersRequestSet": [
  
  
{
  
  
  
"name": "string",
  
  
  
"value": "string"
  
  
}
  
],
  
"headersResponseSet": [
  
  
{
  
  
  
"name": "string",
  
  
  
"value": "string"
  
  
}
  
]
}

Responses

Zone resource updated

JSON
{
  
"@context": "string",
  
"@id": "string",
  
"@type": "string",
  
"id": 42,
  
"organization": "/api/organizations/1",
  
"name": "my-website",
  
"tag": "prod",
  
"banToken": "smoxy_ban_3f8c1a2b4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f809a1b2c3d4e5f607",
  
"createdAt": "2026-01-15T09:30:00+00:00",
  
"updatedAt": "2026-01-20T14:05:00+00:00",
  
"rewriteRules": [
  
  
"https://example.com/"
  
],
  
"configurationRules": [
  
  
"https://example.com/"
  
],
  
"accessRules": [
  
  
"https://example.com/"
  
],
  
"securityScenarios": [
  
  
"https://example.com/"
  
],
  
"enabled": true,
  
"defaultBackend": {
  
  
"type": "string",
  
  
"id": "string"
  
},
  
"cachingDynamicEnabled": false,
  
"cachingRespectCacheControl": true,
  
"cachingDynamicCacheKey": {
  
  
"varyByHostname": true,
  
  
"varyByCookie": [
  
  
]
  
},
  
"cachingStaticEnabled": false,
  
"cachingStaticCacheKey": {
  
  
"varyByHostname": true,
  
  
"varyByQueryString": [
  
  
]
  
},
  
"cachingDefaultTtl": 604800,
  
"cachingIgnoredUrlParams": [
  
],
  
"cachingIgnoredCacheTags": [
  
],
  
"cachingCustomCacheTagHeaders": [
  
  
{
  
  
  
"header": "string",
  
  
  
"delimiter": "string"
  
  
}
  
],
  
"debugHeadersEnabled": false,
  
"processingSsi": false,
  
"processingEsi": false,
  
"underAttack": false,
  
"customPagesErrorEnabled": false,
  
"customPagesMaintenanceActive": false,
  
"customPagesSecurityEnabled": false,
  
"customPagesChallengeEnabled": false,
  
"basicAuthEnabled": false,
  
"basicAuthUsers": [
  
  
{
  
  
  
"@context": "string",
  
  
  
"@id": "string",
  
  
  
"@type": "string",
  
  
  
"id": "9f8b2c1a-4d3e-4f5a-8b6c-7d8e9f0a1b2c",
  
  
  
"username": "jdoe"
  
  
}
  
],
  
"securityEnabled": true,
  
"imageOptimizationEnabled": true,
  
"imageOptimizationWebpEnabled": true,
  
"imageOptimizationAvifEnabled": true,
  
"imageOptimizationAvifQuality": 50,
  
"imageOptimizationWebpQuality": 50,
  
"imageOptimizationJpegQualityTarget": 0.9997,
  
"imageOptimizationJpegEnabled": false,
  
"imageOptimizationJpegQualityMin": 40,
  
"imageOptimizationJpegQualityMax": 98,
  
"imageOptimizationPngEnabled": false,
  
"imageOptimizationPngQualityMin": 40,
  
"imageOptimizationPngQualityMax": 98,
  
"minifyHtml": false,
  
"staleCacheWhileOffline": false,
  
"staleCacheWhileUpdating": false,
  
"cacheErrorResponse": false,
  
"maxRules": 30,
  
"maxWafRules": 3,
  
"maxScenarios": 3,
  
"logForwardingEnabled": false,
  
"logForwardingHostname": "logs.example.com",
  
"logForwardingPort": 514,
  
"logForwardingToken": "abc123def456",
  
"logForwardingProtocol": "tcp",
  
"logForwardingFormat": "json",
  
"createdBy": "/api/organizations/1/members/5",
  
"headersRequestSet": [
  
  
{
  
  
  
"name": "string",
  
  
  
"value": "string"
  
  
}
  
],
  
"headersResponseSet": [
  
  
{
  
  
  
"name": "string",
  
  
  
"value": "string"
  
  
}
  
],
  
"rulesUsed": 5,
  
"wafRulesUsed": 1,
  
"scenariosUsed": 2
}

Playground

Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI