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
I’m using the route https://developers.cloudflare.com/api/operations/dns-records-for-a-zone-delete-dns-record
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
Can you share an example peice of code you are using to make the API call?
Sure this is just listing the dns records which I also get Authentication error on
Does that help or would u like the specific endpoint for dns deleting
Just to be clear, when making a request you replace API_KEY with your actual API key?
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
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
I get the same error
Can you send a screenshot of the permissions you have set up for the API key?
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 issueThat 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
Im gonna give it a try with my cloudflare global api key
Yeah if you are using an api token then you only need the authorization header. You should never have all 3 auth headers
I mean, if the api key can create dns records it should also work for this right?