PHP Client for Cloudflare API
Client Reference

Page Rules

Page Rules endpoint reference.

Settings

Returns a list of settings (and their details) that Page Rules can apply to matching requests.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
php
$response = $client->pageRules()->settings('ZONE_ID');
View this operation on the Cloudflare API Reference

List

List Page Rules in a zone.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
paramsarrayNo[]Query Parameters
php
$response = $client->pageRules()->list('ZONE_ID', []);
View this operation on the Cloudflare API Reference

Create

Create a Page Rule

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
valuesmixedYesValues to set on Page Rule.
php
$response = $client->pageRules()->create('ZONE_ID', $values);
View this operation on the Cloudflare API Reference

Get

Fetches the details of a Page Rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
pageRuleIdstringYesPage Rule Identifier.
php
$response = $client->pageRules()->get('ZONE_ID', 'PAGE_RULE_ID');
View this operation on the Cloudflare API Reference

Edit

Updates one or more fields of an existing Page Rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
pageRuleIdstringYesPage Rule Identifier.
valuesmixedYesValues to set on Page Rule.
php
$response = $client->pageRules()->edit('ZONE_ID', 'PAGE_RULE_ID', $values);
View this operation on the Cloudflare API Reference

Update

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.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
pageRuleIdstringYesPage Rule Identifier.
valuesmixedYesValues to set on Page Rule.
php
$response = $client->pageRules()->update('ZONE_ID', 'PAGE_RULE_ID', $values);
View this operation on the Cloudflare API Reference

Delete

Delete a Page Rule

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
pageRuleIdstringYesPage Rule Identifier.
php
$response = $client->pageRules()->delete('ZONE_ID', 'PAGE_RULE_ID');
View this operation on the Cloudflare API Reference
Copyright © 2026