Skip to content

Add a firewall exception for a false alarm

POST /v1/sites/{siteId}/firewall/exceptions

Turns off firewall rules that stopped something you or a plugin did on purpose (a false alarm), like saving a page in a page builder: name the rules by number, as the event's matchedRules lists them (GET /sites/{siteId}/firewall/events). With path, only on that page and the pages under it (the safest choice; the rest of the site stays fully protected); without, everywhere on the site.

The answer is 201 with the firewall. Location is the new rule's path, /v1/sites/{siteId}/firewall/rules/{ruleId}: its id is the rule's id in rules, and DELETE there removes it. The answer is the firewall with status: "applying" (or installing while the firewall is first set up on the server, a few minutes): the change reaches the server within seconds, then status is active. If it fails, status is failed: apply it again with POST /sites/{siteId}/firewall/actions/apply. Up to 60 changes a minute per account.

Limits. Up to 30 exceptions per site; the same exception can't be added twice (409 conflict).

Scopes

The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).

sites:write
Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.

Headers

FieldType and description
Idempotency-Key

string 1 to 255 characters

A key of your own for this request, like a UUID: letters, digits and _ - : . Send the request again with the same key (after a timeout, say) and it's done only once. Keys are kept for 24 hours (see Idempotency).

Path parameters

FieldType and description
siteId Required

string

The site's id.

Request body

JSON, with these fields. Fields that aren't listed are refused.

FieldType and description
ruleIds Required

array of integers 1 to 12 items

The rules to turn off (1 to 12), by number: the ruleId values of a firewall event's matchedRules.

path

string Up to 300 characters

Only on this page and the pages under it, like /wp-admin/admin-ajax.php (/ is the front page only). Left out: everywhere on the site.

note

string Up to 120 characters

A note for yourself, up to 120 characters.

Example request

curl -X POST "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/firewall/exceptions" \
  -H "Authorization: Bearer $RABBITFLARE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "ruleIds": [
    942270,
    942360
  ],
  "path": "/wp-admin/admin-ajax.php",
  "note": "Page builder saves"
}'

Response

201 Created Returns the SiteFirewall object in data.

The SiteFirewall object's fields 14 fields
FieldType and description
mode

string

protect: attacks are blocked before WordPress sees them (new sites start so). monitor: every request is checked and attacks are logged, but nothing is blocked. off: requests reach WordPress unchecked (blocked addresses are still refused).

Known values: offmonitorprotect More can appear.

sensitivity

string

standard (recommended): stops known attacks with very few false alarms. strict: catches subtler attacks too, but may flag some plugins (add exceptions if it does).

Known values: standardstrict More can appear.

loginProtection

boolean

Whether repeated sign-ins from one address are slowed down (after a few quick tries, one every 6 seconds), so password-guessing bots can't hammer wp-login.php. It works while the firewall is on.

status

string

Whether the settings are in place on the site's server: off, installing (the firewall is being set up on the server first, a few minutes), applying (the latest settings are on their way, usually seconds), active, or failed (see lastError; apply them again with POST /sites/{siteId}/firewall/actions/apply).

Known values: offinstallingapplyingactivefailed More can appear.

lastError

string or null

Why the settings couldn't be put in place (with status: "failed"). Null otherwise.

updatedAt

string or null An ISO 8601 time, in UTC

When the settings or rules last changed. Null when they never did.

rules

array of objects

The site's allowed addresses (up to 100), blocked addresses (up to 500) and exceptions (up to 30), oldest first.

id

string

The rule's id.

kind

string

allow: requests from address skip the firewall's checks. block: requests from address are refused on every page of the site. exception: the rules in ruleIds stop checking requests (on path and the pages under it, or everywhere when path is null).

Known values: allowblockexception More can appear.

address

string or null

The IP address or range, like 203.0.113.7 or 203.0.113.0/24, written as the firewall uses it (a range from its first address). Null for an exception.

ruleIds

array of integers

The firewall rules an exception turns off, by number (as an event's matchedRules names them). Empty for an address.

path

string or null

Where an exception applies: this page and the pages under it (/ is the front page only). Null: everywhere on the site, and always for an address.

note

string or null

The note given when it was added. Null when none was.

createdAt

string An ISO 8601 time, in UTC

When the rule was added.

Example response

201 Created
{
  "data": {
    "mode": "protect",
    "sensitivity": "standard",
    "loginProtection": true,
    "status": "applying",
    "lastError": null,
    "updatedAt": "2026-11-18T10:15:02.000Z",
    "rules": [
      {
        "id": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
        "kind": "block",
        "address": "198.51.100.0/24",
        "ruleIds": [],
        "path": null,
        "note": "Login attempts from a scanner",
        "createdAt": "2026-11-18T09:20:03.000Z"
      },
      {
        "id": "f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c",
        "kind": "exception",
        "address": null,
        "ruleIds": [
          942270,
          942360
        ],
        "path": "/wp-admin/admin-ajax.php",
        "note": "Page builder saves",
        "createdAt": "2026-11-18T09:31:17.000Z"
      }
    ]
  }
}

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 codeWhen, and what to do
403 · 409 limit_reached

A limit is reached: message says which (servers per account, snapshots per server, domains per site, …).

Delete something first, or contact support to raise the limit.

403 feature_unavailable

This product isn't open to the account.

Contact support if you'd like it opened.

404 not_found

The resource doesn't exist, or isn't this account's.

Check the id. Ids of other accounts' resources answer the same way.

409 conflict

This clashes with something that exists, or is already done (for example, a domain already connected to a site).

Read message; there may be nothing left to do.

409 site_unavailable

The site isn't in a state that allows this (for example, it's still installing).

Wait until the site is active, then try again.

409 server_unavailable

The server isn't in a state that allows this (for example, it's off or still being set up).

Start the server, or wait until it's active, then try again.

409 staging_busy

A staging operation is running on this site, or on a site of this server.

Wait until it finishes (activeRun in GET /sites/{siteId}/staging is null again), or cancel it, then try again.

409 server_restoring

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 pendingAction is null again), then try again. A restore that stopped partway keeps pendingAction: "restore", with the server's lastError set, until our team has checked the server.

422 validation_failed

One or more fields are missing or wrong. fields names each one with what's wrong.

Correct the fields named in fields. Unknown fields are refused too.

Rate limit

Write requests: 30 a minute per token, 60 per account. More in Rate limits.

Added on .

Popular

API docs