ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข2y agoโ€ข
2 replies
SageSphinx63920

Simple API request failing

First time working with the cf rest api and some simple api request to purge the cache of a zone if not working and cant figure out why.

This is my request:
curl --request POST \
  --url https://api.cloudflare.com/client/v4/zones/zoneid/purge_cache \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Email: xxxx@gmail.com' \
  --header 'X-Auth-Key: key' \
  --data '{"purge_everything": true}'
{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
curl --request POST \
  --url https://api.cloudflare.com/client/v4/zones/zoneid/purge_cache \
  --header 'Content-Type: application/json' \
  --header 'X-Auth-Email: xxxx@gmail.com' \
  --header 'X-Auth-Key: key' \
  --data '{"purge_everything": true}'
{"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}


The api key has this config:
image.png
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

API Request Failed:
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago
API Request Failed: GET /api/v4/accounts/f9592092c1e8cfe4a09f5c4cf8188ecc/workers/observability/usag
Cloudflare DevelopersCDCloudflare Developers / general-help
2mo ago
r2 api returning unauthorized for every request
Cloudflare DevelopersCDCloudflare Developers / general-help
3y ago
simple question
Cloudflare DevelopersCDCloudflare Developers / general-help
9mo ago