List the requests a site's firewall stopped
/v1/sites/{siteId}/firewall/events Lists the latest requests the site's firewall blocked or flagged, newest first: up to 100 of each, with the address they came from, the page they asked for, the kind of attack and the rules they matched. Filter by blocked. Flagged requests are the ones Monitor mode let through.
They're read from the site's server (kept 20 seconds), so this can take a few seconds; when the server can't be reached it answers 502 server_unreachable. Up to 30 reads a minute per account.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:read - View sites. See sites and their domains, CDN, firewall, malware protection, backups, staging, resources, SMTP and Media Offload. SMTP includes who each site's recent emails went to, their subjects, and the team's sign-in addresses.
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Query parameters
| Field | Type and description |
|---|---|
limit | integer 1 to 100 Default How many items to return, from 1 to 100. Default 25. |
cursor | string 1 to 1,024 characters The |
sort | string Default The field to sort by. Each list names the fields it can be sorted by. One of: |
order | string Default
One of: |
blocked | string
One of: |
Example request
curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true", {
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data, pagination } = await res.json();
console.log(data, pagination.nextCursor); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
for await (const item of rf.sites.firewall.events.list({
siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
blocked: true,
})) {
console.log(item);
} <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events?blocked=true');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
$answer = json_decode($body, true);
print_r($answer['data']);
echo $answer['pagination']['nextCursor'] ?? 'Last page', PHP_EOL; import os
import requests
response = requests.get(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/events",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
params={
"blocked": "true",
},
timeout=120,
)
response.raise_for_status()
answer = response.json()
print(answer["data"], answer["pagination"]["nextCursor"]) Response
200 OK Returns a list of FirewallEvent objects in data, with a Pagination object in pagination.
The FirewallEvent object's fields 14 fields
| Field | Type and description |
|---|---|
id | string The event's id. |
occurredAt | string or null An ISO 8601 time, in UTC When the request came. Null when not known. |
ip | string The IP address the request came from. |
method | string The request's HTTP method, like GET or POST. |
path | string The page asked for, without its query string. |
hasQuery | boolean Whether the address had a query string (left out of |
blocked | boolean Whether the firewall blocked it. False: it was flagged and logged, but let through (in Monitor mode, for example). |
httpStatus | integer The HTTP status the site answered (403 when blocked). |
score | integer or null How suspicious the request looked: the total weight of the rules it matched. Null when not known. |
userAgent | string or null The browser or tool the request said it came from. Null when it sent none. |
category | string What kind of attack it looked like, in words: for example |
matchedRules | array of objects The firewall rules the request matched. |
ruleId | integer The rule's number: an exception ( |
message | string What the rule found. |
Example response
{
"data": [
{
"id": "aZq3Lk2mVt9Xw4Rn7Pb1",
"occurredAt": "2026-11-18T10:02:44.000Z",
"ip": "198.51.100.23",
"method": "GET",
"path": "/shop/",
"hasQuery": true,
"blocked": true,
"httpStatus": 403,
"score": 10,
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"category": "SQL injection",
"matchedRules": [
{
"ruleId": 942270,
"message": "Looking for basic SQL injection. Common attack string for MySQL, Oracle and others"
},
{
"ruleId": 949110,
"message": "Inbound Anomaly Score Exceeded (Total Score: 10)"
}
]
}
],
"pagination": {
"limit": 25,
"hasMore": false,
"nextCursor": null
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 invalid_ | A query parameter is unknown or has a wrong value ( Correct or remove the parameter named in |
400 invalid_ | The cursor isn't one this list gave, or was made with other filters or another sort. Start again from the first page, or keep the filters and sort the cursor was made with. |
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 server_ | The server is being restored, and nothing else can change it or its sites until that's done. Wait until the restore finishes (the server's |
502 server_ | The server didn't answer, or didn't finish the request. Check that the server is running, then try again in a minute. |