curl "https://api.cloudflare.com/client/v4/accounts" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result[].name'

Category: Cloudflare

curl "https://api.cloudflare.com/client/v4/accounts" -H 'Authorization: Bearer $CF_API_TOKEN' | jq '.result[].name'

List accounts the token can access

Returns the Cloudflare accounts your token is scoped to, which gives you the ACCOUNT_ID required by the Workers, R2, and Pages endpoints. Account IDs are 32-character hex strings. If this returns nothing, the token lacks account-level access and will also fail on account APIs.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.