Unable to PATCH PUT or DELETE DNS records with an api token

For Workes & Pages, what is the name of the domain?

example.com

What is the error number?

{“success”:false,“errors”:[{“code”:10000,“message”:“PATCH method not allowed for the api_token authentication scheme”}]}

What is the error message?

DELETE method not allowed for the api_token authentication scheme

What is the issue or error you’re encountering

Unable to edit and existing DNS entry to a new value using Update DNS Record call, or delete it with Delete DNS Record

What steps have you taken to resolve the issue?

Hunted around the website for other sorts of tokens
Searched this forum for other examples, but the error code 10000 is very common

What are the steps to reproduce the issue?

Call the PATCH DNS record using an Authorization Bearer token
curl --request PATCH
–url https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID_AI8/dns_records/
–header ‘Content-Type: application/json’
-H “Authorization: Bearer $CLOUDFLARE_DNS_EDIT_TOKEN”
–data ‘{
“content”: “198.51.100.4”,
“name”: “example.com”,
“proxied”: false,
“type”: “A”,
“comment”: “Domain verification record”,
“id”: “023e105f4ecef8ad9ca31a8372d0c353”,
“tags”: ,
“ttl”: 3600
}’

Are you the superadmin on the account?

Remove the trailing slash

Sorry - it’s not the trailing / - that was just copied from the Doc page example, my actual use didn’t have it.

For PATCH I found out a way around:

You have to not include the ‘name’ entry in the data sent. Which kind of makes sense, but the error message is seriously unhelpful.

For DELETE:

It’s working now. Maybe my token just needed to age a bit?

(It works with or without a trailing / too)

Yes I am.

@Walshy - Sorry, the / at the end of my original post was just where I somehow cut off the final from the URL, not from a doc example at all.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.