What is x-Auth-Key?

Hi all, actually both work,

curl -X POST "https://api.cloudflare.com/client/v4/zones/:zone_id/purge_cache" \
     -H "X-Auth-Email: [email protected]" \
     -H "X-Auth-Key: global api key" \
     -H "Content-Type: application/json" \
     --data '{"purge_everything":true}'

curl -X POST "https://api.cloudflare.com/client/v4/zones/:zone_id/purge_cache" \
     -H "Authorization: Bearer api_token" \
     -H "Content-Type: application/json" \
     --data '{"purge_everything":true}'

I’m new to cloudflare, i made a stupid mistake. i copied the account id from the url, i thought it was zone id.

the error message misleads me

{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
4 Likes