Try the suggestions in this Community Tip to help you fix “Code: 1095 Sorry, you do not have access to purge cache for that zone id or that zone id is invalid” when attempting to purge cache using the API.
The error “Code: 1095 Sorry, you do not have access to purge cache for that zone id or that zone id is invalid” while attempting to purge cache using the API indicates an error occurred and the cache was not purged successfully. When this happens, follow the Quick Fix Ideas in this tip to resolve.
Quick Fix Ideas
You are using your Account ID instead of Zone ID. You can see them both when you login to your Cloudflare dashboard:
There was a temporary issue, wait some time and try again. Attempt to purge the cache again to confirm.
You are receiving the error and have not completely set up your Cloudflare account. Cloudflare will only function and activate your zone if you move your root domain’s nameservers, you cannot delegate a subdomain to us only. We do offer a way of CNAME through our proxy so you do not have to change your nameservers, this is available on our Business and Enterprise plans and is discussed in this guide.
You have a Free or Business plan and are attempting to purge by URL or tag. Purge by tag is only available on the Enterprise plan. Try dropping the part of your command that contains
You’re on a multi-user account and don’t have permission to purge cache. You will need to have your Super Administrator add the Cache Purge permission to your account if you want to use it to purge your cache.
Use an Incognito browser to see if you are able to replicate the issue.
If You Need More Help
This community of other Cloudflare users may be able to assist you, if not, login to Cloudflare and then contact Cloudflare Support. When you contact support, make sure to include as much of this information as possible: the specific error message your are seeing, the URLs this is happening on, screen shot of the error, steps to reproduce the error, and HAR file(s). Please indicate which of the Quick Fix Ideas you’ve tried in order to help Customer Support help you.
Expert Comments Appreciated
This Community Tip will remain open for input from Community experts and those familiar with this issue. We really appreciate comments like: “What are the three things to always try”, or “Do this first” or “In my experience”.
This is a Cloudflare Community Tip, to review other tips, click here.