Where to find, rotate and revoke your Cloudflare API token
Cloudflare calls most credentials API tokens rather than keys. This guide covers where they live, the three credential types, and how to roll or retire one safely.
Checked against these docs on 2026-11-19
Where to find your Cloudflare API tokens
A token’s secret is shown only once, when you create it, so copy it to a secure place straight away. You can check a token with a request to /user/tokens/verify; a valid token returns "status": "active".
- User API tokens: in the dashboard under My Profile then API Tokens.
- Account API tokens: under Manage account then Account API tokens.
- Global API Key: under My Profile then API Tokens, in the API Keys section. Click View next to Global API Key; your account email must be verified first.
Credential types
When you create a token you add policies (Account, User or Zone) with resource rules and permissions. Read allows read and list; Edit allows create, read, update, delete and list. Optional Token expiration and Client IP Address Filtering fields limit how long and from where the token can be used. Older tokens created before 2026 have no prefix and still work.
- User API token (prefix
cfut_). A scoped token that acts on behalf of a user and inherits a subset of that user’s permissions. Good for scripts and one-off tasks. - Account API token (prefix
cfat_). Owned by the account, not a person, so it keeps working after the user who created it leaves. Meant for durable integrations such as CI/CD. Creating one needs API Token Provisioning capabilities or Super Administrator status. - Global API Key (prefix
cfk_). A legacy credential with the user’s full permissions. Cloudflare recommends API tokens instead, because the key can’t be scoped, has no expiry or IP limits, and you get only one per user, which makes rotating it without downtime harder.
How to rotate a Cloudflare token without downtime
Cloudflare’s Roll action generates a new secret with the same access and permissions. In the docs we checked, rolling invalidates the previous token and no grace period is mentioned, so rolling in place can cause a gap if services still hold the old value. For a rotation with no gap:
- Create a second token with the same policies (or the same template), so both work side by side.
- Update every service, CI secret and Worker that used the old token to the new one.
- Confirm they work, for example with the verify request above.
- Retire the old token (see below).
For a token you can afford to interrupt, My Profile, API Tokens, three-dot menu, Roll, Confirm is the shortest path. The Global API Key has a Change action in the same area, but because you can only have one, the swap is never gap-free.
How to revoke a Cloudflare token
Rolling a user token invalidates the old value. For an account-owned token, the Cloudflare API has a delete endpoint, DELETE /accounts/{account_id}/tokens/{token_id}, which destroys the token and needs the Account API Tokens Write permission. To retire a Global API Key, change it from My Profile; Cloudflare recommends moving to API tokens.
The Cloudflare pages we checked don’t spell out dashboard click-paths for deleting a token, so check the token’s menu in the dashboard for that option.
What happens if a Cloudflare token leaks
Cloudflare’s prefixed token formats include a checksum so credential scanners can detect leaks with high confidence, and Cloudflare takes part in GitHub secret scanning. For a leaked token in a public repository, Cloudflare says it automatically revokes the token and emails you so you can create a replacement. For private repositories, GitHub notifies you so you can rotate; the docs don’t say Cloudflare revokes those automatically.
GitHub lists Cloudflare Account API Tokens, User API Tokens and Global API Keys as partner patterns with push protection.
So after any leak, roll or delete the token yourself, and check your zones and settings for changes you didn’t make.
Recommended rotation practice
- Prefer scoped API tokens over the Global API Key.
- Use account tokens for CI/CD and other long-lived integrations, so they don’t depend on one person’s account. Use user tokens for ad hoc scripts.
- Give each integration its own token with the narrowest permissions and zone scope, and set an expiration date and an IP filter where you can.
- Rotate when someone with access to a token leaves, and whenever a token may have been exposed.
- Cloudflare doesn’t publish a fixed rotation interval in the docs we checked, so choose one and record it.
Sources
Everything above comes from these pages. Providers change their dashboards, so check them for the latest. KeyAtlas is not affiliated with Cloudflare.