Page Rules

page_rules

Methods

Create A Page Rule -> Envelope<>
post/zones/{zone_id}/pagerules

Creates a new Page Rule.

Delete A Page Rule -> Envelope<{ id }>
delete/zones/{zone_id}/pagerules/{pagerule_id}

Deletes an existing Page Rule.

Edit A Page Rule -> Envelope<>
patch/zones/{zone_id}/pagerules/{pagerule_id}

Updates one or more fields of an existing Page Rule.

Get A Page Rule -> Envelope<>
get/zones/{zone_id}/pagerules/{pagerule_id}

Fetches the details of a Page Rule.

List Page Rules -> Envelope<Array<>>
get/zones/{zone_id}/pagerules

Fetches Page Rules in a zone.

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Parameters
zone_id: string

Identifier

direction:
Optional

The direction used to sort returned Page Rules.

"asc"
"desc"
match:
Optional

When set to all, all the search requirements must match. When set to any, only one of the search requirements has to match.

"any"
"all"
order:
Optional

The field used to sort returned Page Rules.

"status"
"priority"
status:
Optional

The status of the Page Rule.

"active"
"disabled"
Response fields
errors: Array<>
messages: Array<>
success: true

Whether the API call was successful

result: Array<>
Optional
Request example
200Example
Update A Page Rule -> Envelope<>
put/zones/{zone_id}/pagerules/{pagerule_id}

Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.

Domain types

PageRule = { id, actions, created_on, 4 more... }
Target = { constraint, target }