Accounts
Access Rules
IP Access rules defined at the account level, applying to every zone in the account.
IP Access rules defined at the account level, applying to every zone in the account.
List
List, search, sort and filter an account's IP Access rules.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
params | array | No | [] | Query Parameters: `mode`, `configuration.target`, `configuration.value`, `notes`, `match`, `page`, `per_page`, `order` and `direction`. |
php
$response = $client->accounts()->accessRules()->list('ACCOUNT_ID', []);
Create
Create an IP Access rule for every zone in an account.
$client->accounts()->accessRules()->create('ACCOUNT_ID', [
'mode' => 'block',
'configuration' => ['target' => 'ip', 'value' => '198.51.100.4'],
'notes' => 'Blocked for abuse',
]);
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
values | array | Yes | `mode`, one of `block`, `challenge`, `whitelist`, `js_challenge` or `managed_challenge`, and `configuration` with its `target` (`ip`, `ip_range`, `asn` or `country`) and `value`. `notes` is optional. |
php
$response = $client->accounts()->accessRules()->create('ACCOUNT_ID', []);
Get
Get a single IP Access rule defined at the account level.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
ruleId | string | Yes | IP Access Rule Identifier. |
php
$response = $client->accounts()->accessRules()->get('ACCOUNT_ID', 'RULE_ID');
Edit
Apply changes to an IP Access rule, overwriting only the supplied properties.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
ruleId | string | Yes | IP Access Rule Identifier. | |
values | array | Yes | Values to set on the IP Access rule, e.g. `mode`, `notes`. |
php
$response = $client->accounts()->accessRules()->edit('ACCOUNT_ID', 'RULE_ID', []);
Delete
Delete an IP Access rule defined at the account level.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
ruleId | string | Yes | IP Access Rule Identifier. |
php
$response = $client->accounts()->accessRules()->delete('ACCOUNT_ID', 'RULE_ID');

