Skip to main content
The Bot Management API allows you to configure bot detection and mitigation settings for your zones. It supports Bot Fight Mode, Super Bot Fight Mode, and Bot Management for Enterprise with advanced ML-based bot detection.

Initialize the Bot Management resource

Configuration management

Get configuration

Retrieve the current Bot Management configuration for a zone.

Update configuration

Update Bot Management settings for a zone.
string
required
Zone identifier
string
Enable rule to block AI Scrapers and Crawlers. Options:
  • block - Block AI scrapers and crawlers
  • disabled - Allow AI scrapers and crawlers
  • only_on_ad_pages - Block only on ad pages (not available for Enterprise)
string
Specifies the Robots Access Control License variant to use. Options:
  • off - Disable robots.txt management
  • policy_only - Use policy-based robots.txt
string
Enable rule to punish AI Scrapers and Crawlers via a link maze. Options:
  • enabled - Enable crawler protection
  • disabled - Disable crawler protection
boolean
Use lightweight, invisible JavaScript detections to improve Bot Management. Learn more about JavaScript Detections.
boolean
Whether to enable Bot Fight Mode
boolean
Enable cloudflare managed robots.txt. If an existing robots.txt is detected, then managed robots.txt will be prepended to the existing robots.txt.

Bot Fight Mode configuration

Bot Fight Mode is a basic bot protection plan suitable for smaller sites.

Super Bot Fight Mode configuration

Super Bot Fight Mode provides enhanced bot protection with more granular control.

Super Bot Fight Mode - Definitely automated

string
Action to take on definitely automated requests. Options:
  • allow - Allow the request
  • block - Block the request
  • managed_challenge - Issue a managed challenge
string
Action to take on verified bot requests. Options:
  • allow - Allow verified bots
  • block - Block verified bots
boolean
Enable static resource protection. Enable if static resources on your application need bot protection. Note: This can also result in legitimate traffic being blocked.
boolean
Whether to optimize Super Bot Fight Mode protections for WordPress

Super Bot Fight Mode - Likely automated

string
Action to take on likely automated requests. Options:
  • allow - Allow the request
  • block - Block the request
  • managed_challenge - Issue a managed challenge

Bot Management for Enterprise configuration

Enterprise Bot Management provides the most advanced bot detection using machine learning.
boolean
Automatically update to the newest bot detection models created by Cloudflare as they are released. Learn more.
Indicates that the bot management cookie can be placed on end user devices accessing the site. Defaults to true.
boolean
Whether to disable tracking the highest bot score for a session in the Bot Management cookie

Cleaning up configuration after plan changes

When upgrading or downgrading your bot management plan, you may need to clean up old configurations.

Clean up for Bot Fight Mode

Clean up for Super Bot Fight Mode Pro

Clean up for Super Bot Fight Mode Business

Clean up for Bot Management Enterprise

Ensure you have custom rules in place to protect your zone before disabling SBFM rules. Without these protections, your zone is vulnerable to attacks.

Response types

BotFightModeConfiguration

Configuration for Bot Fight Mode.
boolean
Whether Bot Fight Mode is enabled
boolean
Whether JavaScript detections are enabled
string
AI bots protection setting
string
Robots Access Control License variant
string
Crawler protection setting
boolean
Whether robots.txt is managed by Cloudflare
boolean
Whether the zone is using the latest ML model
object
Unauthorized settings currently active on the zone (typically from upgrades/downgrades)

SubscriptionConfiguration

Configuration for Enterprise Bot Management subscription.
boolean
Whether automatic model updates are enabled
Whether the bot management cookie is enabled
boolean
Whether session score tracking is suppressed
boolean
Whether JavaScript detections are enabled
string
AI bots protection setting
boolean
Whether the zone is using the latest ML model