You could try the Firewall API and create a new rule, https://developers.cloudflare.com/api/resource

Interact with Cloudflare's products and services via the Cloudflare API
Was this page helpful?