PHP Client for Cloudflare API
Client Reference

Access Rules

Access Rules endpoint reference.

List

List, search, sort, and filter a zone's IP Access rules.

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

Create

Create a new IP Access rule for a zone.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
valuesarrayYesValues to set on the IP Access rule, e.g. `mode`, `configuration` (`target`, `value`), `notes`.
php
$response = $client->accessRules()->create('ZONE_ID', []);
View this operation on the Cloudflare API Reference

Edit

Apply changes to an existing IP Access rule for a zone, overwriting only the supplied properties.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
ruleIdstringYesIP Access Rule Identifier.
valuesarrayYesValues to set on the IP Access rule, e.g. `mode`, `notes`.
php
$response = $client->accessRules()->edit('ZONE_ID', 'RULE_ID', []);
View this operation on the Cloudflare API Reference

Delete

Delete an IP Access rule for a zone.

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