Before you begin,find your zone and account IDs.
Determine if you want a user token or anAccount owned token. Use Account owned tokens if you prefer service tokens that are not associated with users and yourdesired API endpoints are compatible.
From theCloudflare dashboard ↗, go toMy Profile >API Tokens for user tokens. For Account Tokens, go toManage Account >API Tokens.
SelectCreate Token.
Select a template from the availableAPI token templates or create a custom token. The following example uses theEdit zone DNS template.
Add or edit the token name to describe why or how the token is used. Templates are prefilled with a token name and permissions.
Modify the token's permissions. After selecting a permissions group (Account,User, orZone), choose what level of access to grant the token. Most groups offer
Edit
orRead
options.Edit
is full CRUDL (create, read, update, delete, list) access, whileRead
is the read permission and list where appropriate. Refer to theavailable token permissions for more information.Select which resources the token is authorized to access. For example, granting
Zone DNS Read
access to a zoneexample.com
will allow the token to read DNS records only for that specific zone. Any other zone will return an error for DNS record reads operations. Any other operation on that zone will also return an error.(Optional) Restrict how a token is used in theClient IP Address Filtering andTTL (time to live) fields.
SelectContinue to summary.
Review the token summary. SelectEdit token to make adjustments. You can also edit a token after creation.

- SelectCreate Token to generate the token's secret.
- Copy the secret to a secure place.
The token secret isonly shown once. Do not store the secret in plaintext where others can access it. Anyone with this token can perform the authorized actions against the resources that the token has access to.

The token secret page also includes an example command to test the token. Use the/user/tokens/verify
endpoint to fetch the current status of the given token.
curl"https://api.cloudflare.com/client/v4/user/tokens/verify"\--header"Authorization: Bearer <API_TOKEN>"
The result:
{"result":{"id":"100bf38cc8393103870917dd535e0628","status":"active"},"success":true,"errors":[],"messages":[{"code":10000,"message":"This API Token is valid and active","type":null}]}
With this you have successfully created an API token and can start working with the Cloudflare API. After creating your first API token, you can create additional API tokensvia the API.
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark