Create a page rule
Creates a new Page Rule for a zone.string
required
The zone identifier
array
required
The set of actions to perform if the targets of this rule match the request. Actions can redirect to another URL or override settings, but not both.
array
required
The rule targets to evaluate on each request.
object
string
Set to
url for URL-based targetingnumber
The priority of the rule. A higher number indicates higher priority. Used when multiple Page Rules could match the same URL.
string
The status of the Page Rule:
active or disabledAvailable actions
Page Rules support numerous actions to customize behavior: Cache settings:browser_cache_ttl- Set browser cache TTLcache_level- Set cache level (bypass, basic, simplified, aggressive, cache_everything)edge_cache_ttl- Set edge cache TTLcache_by_device_type- Cache based on device typecache_deception_armor- Protect from cache deception attackscache_key_fields- Control cache key variablescache_on_cookie- Cache based on cookie matchcache_ttl_by_status- Set TTL by response status codebypass_cache_on_cookie- Bypass cache if cookie matchesexplicit_cache_control- Origin cache control
browser_check- Enable browser integrity checkemail_obfuscation- Obfuscate email addressesip_geolocation- Add IP geolocation headerssecurity_level- Set security levelwaf- Enable/disable WAFdisable_security- Turn off security features
automatic_https_rewrites- Rewrite HTTP to HTTPSmirage- Enable Mirage image optimizationpolish- Enable Polish image compressionrocket_loader- Enable Rocket Loaderdisable_performance- Turn off performance features
always_use_https- Redirect HTTP to HTTPSssl- Set SSL modeopportunistic_encryption- Enable opportunistic encryption
forwarding_url- Redirect to another URLhost_header_override- Override host headerresolve_override- Override origin address
disable_apps- Turn off Cloudflare Appsdisable_zaraz- Turn off Zarazorigin_error_page_pass_thru- Pass through origin error pagesresponse_buffering- Enable response bufferingrespect_strong_etag- Respect strong ETagssort_query_string_for_cache- Sort query stringstrue_client_ip_header- Add True-Client-IP header
string
The Page Rule identifier
array
The configured actions for this rule
array
The URL targets for this rule
number
The rule priority
string
The rule status (active or disabled)
string
Timestamp when the rule was created
string
Timestamp when the rule was last modified
Update a page rule
Replaces the configuration of an existing Page Rule. The configuration will exactly match the data provided.string
required
The Page Rule identifier
string
required
The zone identifier
List page rules
Fetches all Page Rules in a zone.string
required
The zone identifier
string
Filter by status:
active or disabledstring
Field to sort by:
status or prioritystring
Sort direction:
asc or descstring
Match mode:
any or all (when using multiple filters)Get a page rule
Fetches details of a single Page Rule.string
required
The Page Rule identifier
string
required
The zone identifier
Edit a page rule
Updates one or more fields of an existing Page Rule.string
required
The Page Rule identifier
string
required
The zone identifier
Delete a page rule
Deletes an existing Page Rule.string
required
The Page Rule identifier
string
required
The zone identifier