API: Security and alerts

Attack protection, the request limit and bot blocking, access rules and limits per path, the firewall and its exceptions, and alerts by email, SMS, Telegram or webhook.

POST /domains/{domain}/services/attack security

Attack protection

The protection level, the request limit per visitor and bot blocking.

Body fieldValuesMeaning
value off | basic | attack off, basic (request limits) or attack (under attack: every visitor waits for a short browser check).
rate 10 | 30 | 60 | 120 Most requests a second per visitor.
suspicious 1 | 0 Check visitors that look suspicious.
block_ai 1 | 0 Block AI crawlers.
block_bad 1 | 0 Block known bad bots.
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"value":"attack","rate":"30","block_bad":"1"}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/attack
POST /domains/{domain}/services/attack security

Rules per AI crawler

Allow or block each AI crawler on its own; an empty value puts it back to the block_ai switch. GET services lists the crawlers in attack.ai_crawlers and your rules in attack.ai_rules.

Body fieldValuesMeaning
fieldRequired ai_rules ai_rules.
ai_rulesRequired Text An object of crawler name => allow, block or "" (back to the default).
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"field":"ai_rules","ai_rules":{"GPTBot":"block","OAI-SearchBot":"allow","CCBot":""}}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/attack
POST /domains/{domain}/services/attack security

Content signals for AI

The nodes add a Content-Signal line to your robots.txt (and serve one when your site has none), telling AI crawlers whether your pages may be used for search, AI answers or training. An empty value removes one signal.

Body fieldValuesMeaning
fieldRequired content_signals content_signals.
content_signalsRequired Text An object with search, ai-input and ai-train set to yes or no ("" removes it).
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"field":"content_signals","content_signals":{"search":"yes","ai-input":"no","ai-train":"no"}}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/attack
POST /domains/{domain}/services/waf firewall

Web application firewall

Start with detect (log only), check the events, then switch to block.

Body fieldValuesMeaning
valueRequired off | detect | block off, detect (log only) or block.
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"value":"block"}' https://my.cloud9.ir/api/customer/v1/domains/example.com/services/waf
{"ok":true,"data":{"message":"The firewall setting was saved.","changes":{"waf":"block"}}}
POST /domains/{domain}/services/access security

Access rules and limits per path

Block addresses, networks or countries, always allow your own addresses, skip the browser check on paths such as /api/ or bank callbacks, let search engine crawlers pass, and set request limits per path. Only the lists you send change.

Body fieldValuesMeaning
block Text Addresses, networks or two-letter country codes, one per line (up to 500).
allow Text Addresses or networks that never meet a limit or a check, one per line (up to 500).
paths Text Paths that skip the browser check, one per line, such as /api/.
crawlers 1 | 0 Let Google and Bing crawlers through from their published addresses.
limits Text One per line: /path N [write], N requests a minute per visitor (5, 10, 20, 30, 60 or 120), write = only POST and other writes (up to 20).
curl -X POST -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"block":"198.51.100.0/24\nCN","limits":"/wp-login.php 5\n/api/ 60 write"}' \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/access
GET /domains/{domain}/firewall-events services.read

Firewall events

The newest web firewall events of the proxied names, with the reference number the visitor saw.

curl -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/firewall-events
POST /domains/{domain}/services/wafexcl firewall

Firewall exceptions

One exception per line: a rule id, a path, or a path with rule ids (up to 100). With action add, the line is added to the list.

Body fieldValuesMeaning
exclusions Text The whole list, one exception per line.
action add add: append the line in exclusions instead of replacing the list.
curl -X POST -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/wafexcl
POST /domains/{domain}/services/alerts security

Alerts

Get told when an origin goes down or answers many 502/504 errors in ten minutes: by email, SMS to your confirmed mobile, Telegram or a signed webhook. alert_test sends a test and saves nothing.

Body fieldValuesMeaning
alerts_on 1 | 0 Alerts on or off.
alert_email 1 | 0 Send alerts by email.
alert_sms 1 | 0 Send alerts by SMS to the confirmed mobile.
alert_errors 0 | 10 | 20 | 50 | 100 | 200 Alert when this many 502/504 errors happen in ten minutes; 0 turns it off.
telegram_token Text Your own Telegram bot token, from BotFather.
telegram_chat Text Telegram chat id or @channel.
webhook_url Text An https address that gets a JSON POST signed with X-Signature (HMAC-SHA256).
webhook_new 1 Make a new signing secret.
alert_test 1 Send a test alert now; nothing is saved.
curl -X POST -H "Authorization: Bearer $KEY" \
  https://my.cloud9.ir/api/customer/v1/domains/example.com/services/alerts

No answer here? Sign in to the portal and open a ticket. Open a ticket