PHP Client for Cloudflare API
Firewall

Lockdowns

Lockdowns 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->firewall()->lockdowns()->list('ZONE_ID', []);
View this operation on the Cloudflare API Reference

Create

Creates a new Zone Lockdown rule.

ParamTypeRequiredDefaultDescription
zoneIdstringYesZone Identifier.
valuesarrayYes`urls` and `configurations` are required. Each configuration is `['target' => …, 'value' => …]`, where the target is `ip`, `ip_range`, `asn` or `country`. `description`, `priority` and `paused` are optional.
php
$response = $client->firewall()->lockdowns()->create('ZONE_ID', []);

::callout{icon="i-simple-icons-cloudflare" to="https://developers.cloudflare.com/api/resources/firewall/subresources/lockdowns/methods/create/ ```php $client->firewall()->lockdowns()->create('ZONE_ID', 'urls' => 'example.com/admin*', 'configurations' => [ 'target' => 'ip', 'value' => '198.51.100.4', 'target' => 'country', 'value' => 'US', ], 'description' => 'Admin area', );

View this operation on the Cloudflare API Reference
::

## Get

Fetches the details of a Zone Lockdown rule.

::params-table
---
params:
  - name: "zoneId"
    type: "string"
    required: true
    description: "Zone Identifier."
  - name: "lockdownId"
    type: "string"
    required: true
    description: "Lockdown identifier ."
---
::

```php [php]
$response = $client->firewall()->lockdowns()->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
valuesarrayYes`urls` and `configurations` are required, in the same shape as `create()`.
php
$response = $client->firewall()->lockdowns()->update('ZONE_ID', 'LOCKDOWN_ID', []);
View this operation on the Cloudflare API Reference

Delete

Deletes an existing Zone Lockdown rule.

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