Global enable Bot Fight Mode?

Is there a way for me to quickly enable this on all sites in the GUI? API…anyone got a script?

You’d have to send individual requests for each domain, however a PUT request to https://api.cloudflare.com/client/v4/zones/ZONEID/bot_management should do the trick

Make sure to insert the appropriate zone id, authentication email, and authentication key.

curl -X PUT "https://api.cloudflare.com/client/v4/zones/ZONEID/bot_management" \
     -H "X-Auth-Email: AUTHEMAIL" \
     -H "X-Auth-Key: AUTHKEY" \
     -H "Content-Type: application/json" \
     --data '{"fight_mode":true}'

Simply run this in a loop for all your zone ids and you should be good to go.

Also, that call hasnt been officially announced yet, so it might change at any time.

4 Likes

Cool. I will play with that. Thanks

1 Like

Any estimate when this function will make it into API docs?

Has this functionality changed? It does not appear to work anymore? I get no errors from the API call, however, the setting does not change in the web interface. All other API calls I send update the correct settings, just not this one. Any ideas?

Still appears to work for me.

Keep in mind though, that interface was never official.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.