PHP Client for Cloudflare API
Client Reference

Lockdown

Lockdown endpoint reference.

List

Fetches Zone Lockdown rules. You can filter the results using several optional parameters.

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

Create

Creates a new Zone Lockdown rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
valuestringYesThe IP address/range to match. You can only use prefix lengths /16 and /24. This address/range will be compared to the IP address of incoming requests.
urlsarrayYesThe URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
php
$response = $client->lockdown()->create('ZONE_ID', 'VALUE', []);
View this operation on the Cloudflare API Reference

Get

Fetches the details of a Zone Lockdown rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
lockdownIdstringYesLockdown identifie
php
$response = $client->lockdown()->get('ZONE_ID', 'LOCKDOWN_ID');
View this operation on the Cloudflare API Reference

Update

Updates an existing Zone Lockdown rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
lockdownIdstringYesLockdown identifier
valuestringYesThe IP address/range to match. You can only use prefix lengths /16 and /24. This address/range will be compared to the IP address of incoming requests.
urlsarrayYesThe URLs to include in the current WAF override. You can use wildcards. Each entered URL will be escaped before use, which means you can only use simple wildcard patterns.
php
$response = $client->lockdown()->update('ZONE_ID', 'LOCKDOWN_ID', 'VALUE', []);
View this operation on the Cloudflare API Reference

Delete

Deletes an existing Zone Lockdown rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
lockdownIdstringYesLockdown identifier
php
$response = $client->lockdown()->delete('ZONE_ID', 'LOCKDOWN_ID');
View this operation on the Cloudflare API Reference
Copyright © 2026