Deleting DNS Record with API Endpoint

I am attempting to delete a dns record from our zone and I am only getting the status code 10000 and "Authentication error", I am using the same api key to create dns records which works fine but no matter which headers I put in, Ex. X-Auth-Key, X-Auth-Email, Authorization I just get the same error (putting these in all at the same time). The email I provided is the owner of this domain on cloudflare and the api key is the one I use to create dns records.
35 Replies
Nopox
Nopox9mo ago
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
Cyb3r-Jak3
Cyb3r-Jak39mo ago
Can you share an example peice of code you are using to make the API call?
Nopox
Nopox9mo ago
Sure this is just listing the dns records which I also get Authentication error on
No description
Nopox
Nopox9mo ago
Does that help or would u like the specific endpoint for dns deleting
Metriusz
Metriusz9mo ago
Just to be clear, when making a request you replace API_KEY with your actual API key?
Nopox
Nopox9mo ago
Yeah, same for email and Authorization I'm not sure what email is supposed to be there but I replaced it with the email that created this specific api key
Metriusz
Metriusz9mo ago
I think you can skip both of those when using the Authorization header with an API key In fact you may want to try that
Nopox
Nopox9mo ago
I get the same error
Metriusz
Metriusz9mo ago
Can you send a screenshot of the permissions you have set up for the API key?
Nopox
Nopox9mo ago
No description
AlphaCentauri
AlphaCentauri9mo ago
Instead of trying to set the headers manually, why don't you clear everything from there and within Insomnia just select Auth > Bearer Token and then just paste in your token without the Bearer prefix? Might solve the issue
Metriusz
Metriusz9mo ago
That seems right, you could try double checking if the zone ID is right, as well as temporarily increasing the permissions for the API key to the issue might be related to that
Nopox
Nopox9mo ago
Im gonna give it a try with my cloudflare global api key
Cyb3r-Jak3
Cyb3r-Jak39mo ago
Yeah if you are using an api token then you only need the authorization header. You should never have all 3 auth headers
Nopox
Nopox9mo ago
I mean, if the api key can create dns records it should also work for this right?
Want results from more Discord servers?
Add your server