Block Visitor

POST /v1/account/nudges/{uuid}/block-visitor

Act on a cf_visitor_flood nudge — one visitor sent one of your sites behind Cloudflare far more requests than usual (how it works): block that visitor on that site. This creates a firewall policy that blocks the visitor's IP address on that one site only, named Block <ip> on <site>, and dismisses the nudge. Other visitors and the account's other sites are not affected. It's the dashboard's Block this visitor. No request body.

To undo it, delete the policy (its policy_uuid). To slow the visitor down instead of blocking it, add a rate limit for the site: each visitor's requests are counted on their own.

Permissions: what creating a firewall policy with conditions needs — the firewall create and update permissions, and the firewall_policies entitlement, plus Traffic Inspector read to see the nudge at all. The new policy counts toward the plan's firewall policies. Refused while the account is suspended.

Path parameters

uuid string (uuid) Req
The uuid of a pending cf_visitor_flood nudge from GET /v1/account/nudges (its visitor_ip and host name the visitor and the site).

Response (201 Created)

policy_uuid string (uuid)
The firewall policy that blocks the visitor. Use it with GET /v1/firewall/policies/{uuid} or to delete the policy.
policy_name string
Block <ip> on <site>, the name the policy is listed under.
existed boolean
false: the policy was created.

Response (200 OK)

The same fields with existed: true: that policy was already there, so nothing new is created. The nudge is dismissed all the same.

Errors

401 Unauthorized
Missing or invalid auth.
403 Forbidden
The plan's firewall policies are used up (You've reached your plan's limit of … firewall policies — delete one or upgrade your plan), the plan doesn't include firewall_policies, your role lacks the firewall create or update permission, or the account is suspended (code account_suspended).
404 Not Found
No cf_visitor_flood nudge to act on: it was already resolved or dismissed, it is another kind of nudge, there is no such nudge in the active account, or your role can't read the account's traffic.
409 Conflict
The site was deleted, so there is nothing to block. Dismiss the nudge instead.
415 Unsupported Media Type
Content-Type must be application/json — send the header even though there is no body.
Request
curl -X POST "https://api.ngris.com/v1/account/nudges/019b002a-8b10-7965-8ec9-97bded381ab9/block-visitor" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json"
Response — 201 Created
{ "policy_uuid": "019b0a11-2c3d-7e4f-8a9b-0c1d2e3f4a5b", "policy_name": "Block 203.0.113.7 on shop.example.com", "existed": false }
Was this helpful?
On this page
Block Visitor
Was this helpful?