You could try the Firewall API and create a new rule, https://developers.cloudflare.com/api/resource
You could try the Firewall API and create a new rule, https://developers.cloudflare.com/api/resources/firewall/subresources/rules/methods/create/
Interact with Cloudflare's products and services via the Cloudflare API