bunny.net CDN and Shield
v1.0.1Debug bunny.net CDN pull zones and manage bunny Shield: WAF, rate limits, bot detection, event logs
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_pull_zones
List bunny.net pull zones (CDN sites) with their IDs, origins and hostnames.
| Parameter | Type | Description |
|---|---|---|
page | integer | |
perPage | integer | |
search | string | Filter by name or hostname |
get_pull_zone
One pull zone: hostnames, edge rules as readable one-line summaries (Guid first) and the caching, origin and security settings that matter when debugging. Credentials (ZoneSecurityKey, AWS signing keys, cookie and Authorization trigger values) are left out. For other settings, pass `fields` with the raw names; `detail: true` returns the full raw object (about 10,000 tokens) with the same credentials hidden.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
detail | boolean | Return the full raw object. Default false |
fields | array | Raw field names to return, e.g. ["OptimizerEnabled"] |
cdn_statistics
CDN statistics: bandwidth, requests, cache hit rate and, with load_errors, non-2xx responses. Defaults to the last 30 days across all pull zones.
| Parameter | Type | Description |
|---|---|---|
date_from | string | ISO 8601 date |
date_to | string | ISO 8601 date |
hourly | boolean | |
load_errors | boolean | |
pull_zone_id | integer | Pull zone ID from list_pull_zones |
update_pull_zone
Change pull zone settings and return what changed. Send only the fields to change, using the raw names (e.g. CacheControlMaxAgeOverride, UseStaleWhileOffline); read current values with get_pull_zone and `fields`. `alsoChanged` lists settings Bunny changed that were not requested. Edit edge rules with save_edge_rule, not here.
| Parameter | Type | Description |
|---|---|---|
fields * | object | |
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
purge_cache
Purge the CDN cache for one URL (wildcard * allowed at the end), or for a whole pull zone.
| Parameter | Type | Description |
|---|---|---|
cache_tag | string | With pull_zone_id: purge only this cache tag |
pull_zone_id | integer | Pull zone ID from list_pull_zones |
url | string |
save_edge_rule
Create an edge rule, or update one by including its Guid (from get_pull_zone). Send the whole rule, not only changed fields; to switch a rule on or off use set_edge_rule_enabled. Fields: ActionType, ActionParameter1-3, Triggers [{Type, PatternMatches[], PatternMatchingType, Parameter1}], TriggerMatchingType, Description, Enabled, OrderIndex, ExtraActions [{ActionType, ActionParameter1-3}]. ActionType: 0 Force SSL, 1 Redirect, 2 Origin URL, 3 Override Cache Time, 4 Block Request, 5 Set Response Header, 6 Set Request Header, 7 Force Download, 8 Disable Token Authentication, 9 Enable Token Authen…
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
rule * | object |
set_edge_rule_enabled
Switch an edge rule on or off without resending the whole rule.
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | |
guid * | string | Edge rule Guid from get_pull_zone |
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
origin_errors
Bunny's log of failed requests to a pull zone's origin on one day: why each failed (e.g. http_timeout, http_request_failure, dns_lookup, network_socket_exception). Use it to confirm 502 or 504 errors from Bunny's side. Origin responses with an error status, such as a PHP-FPM 502, may not appear here. Returns counts and samples for one page of up to 200 entries. Which part of the day that page covers varies between calls, so check from and to; hasMoreData means other entries exist that this tool does not fetch.
| Parameter | Type | Description |
|---|---|---|
date * | string | Day to read, as YYYY-MM-DD (UTC) |
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
detail | boolean | Return the raw entries, including request headers (very large). Default false |
delete_edge_rule
Permanently delete an edge rule. To switch one off but keep it, save it with Enabled: false instead.
| Parameter | Type | Description |
|---|---|---|
guid * | string | Edge rule Guid from get_pull_zone |
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
get_shield_zone
WAF (bunny Shield) state for a pull zone: zone settings (wafEnabled, wafExecutionMode, wafDisabledRules, wafLogOnlyRules, learningMode), custom WAF rules, rate limits and bot detection. Read `notes` first: it explains coded settings and warns when settings stop rules from acting.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
shield_event_logs
Requests the WAF blocked, challenged or logged for a pull zone. Only the last 72 hours are available. Use group_by to summarise, e.g. ["ruleId"], ["ja4"] or ["ip"]. Events can take a minute to appear, so wait at least a minute after a change before judging it.
| Parameter | Type | Description |
|---|---|---|
from * | string | ISO 8601 date-time, within the last 72 hours |
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
detail | boolean | Include each group's full context object (large). Default false |
group_by | array | |
page | integer | Zero-based |
page_size | integer | Default 50 |
query | string | Free text across IP, ruleId, URL, User-Agent and rule name |
to | string | ISO 8601 date-time; defaults to now |
update_shield_zone
Change WAF settings for a pull zone and return what changed. Fields use the names get_shield_zone returns: wafEnabled, wafExecutionMode (0 Log (no rule blocks, including custom Block rules), 1 Block), learningMode, wafDisabledRules, wafLogOnlyRules, dDoSShieldSensitivity and others. A list in `fields` replaces the whole list; to change part of a list use `add` or `remove`, e.g. add: {"wafDisabledRules": ["942100"]}.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
add | object | Items to add to list fields |
fields | object | |
remove | object | Items to remove from list fields |
update_bot_detection
Change bot detection for a pull zone and return what changed. executionMode: 0 LogOnly, 1 Challenge. requestIntegrity, ipAddress and browserFingerprint each take {sensitivity: 0 Off, 1 Low, 2 Medium, 3 High}; browserFingerprint also takes aggression and complexEnabled. Read the current values with get_shield_zone.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
browserFingerprint | object | |
executionMode | number | 0 LogOnly, 1 Challenge |
ipAddress | object | |
requestIntegrity | object |
save_waf_rule
Create a custom WAF rule (no rule_id) or update one (with rule_id; send the whole rule). To test a rule, save it with actionType 2 (Log), check shield_event_logs, then save it again with 1 (Block). Returns warnings when zone settings would stop the rule from acting.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
ruleConfiguration * | object | |
ruleName * | string | |
ruleDescription | string | |
rule_id | integer |
save_rate_limit
Create a rate limit (no rule_id) or update one (with rule_id). Fields: ruleName and ruleDescription (letters, numbers and spaces only) and ruleConfiguration. Copy the ruleConfiguration shape from an existing rate limit in get_shield_zone.
| Parameter | Type | Description |
|---|---|---|
pull_zone_id * | integer | Pull zone ID from list_pull_zones |
ruleConfiguration * | object | |
ruleName * | string | |
ruleDescription | string | |
rule_id | integer |
delete_shield_rule
Permanently delete a custom WAF rule or a rate limit by its ID from get_shield_zone. To keep a WAF rule but stop it acting, save it with actionType 2 (Log) instead.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
rule_id * | integer |