Cloudflare API

Welcome to Cloudflare's updated API reference documentation. This site is in beta while we iterate on improvements. If you have feedback, please let us know through this feedback form: API Site Beta Feedback 2024.

To get started using Cloudflare's products and services via the API, refer to how to interact with Cloudflare, which covers using tools like Terraform and the official SDKs to maintain your Cloudflare resources.

Using the Cloudflare API requires authentication so that Cloudflare knows who is making requests and what permissions you have. Create an API token to grant access to the API to perform actions. You can also authenticate with API keys, but these keys have several limitations that make them less secure than API tokens. Whenever possible, use API tokens to interact with the Cloudflare API.

To create an API token, from the Cloudflare dashboard, go to My Profile → API Tokens and select Create Token. For more information on how to create and troubleshoot API tokens, refer to our API fundamentals.

Totally new to Cloudflare? Start here.