DNS Update: PUT Method with API token not supported

I’m trying to use the API Tokens to update a DNS entry. I’m in return getting a Code 10000 error that “PUT method with API Tokens is not supported by this API”. Is there an endpoint that I can use to update the DNS entry using a Token and not my global Key? The token has appropriate DNS Edit access.

curl -X PUT "https://api.cloudflare.com/client/v4/zones/:zoneID/dns_records/:ID \
-H "Authorization: Bearer :TOKEN" \
-H "Content-Type: application.json" \
--data "{\"type\":\"A\",\"name\":\"${DOMAIN}\",\"content\":\"${NEW_IP}\",\"ttl\":1}"

Same here, getting the same error from the PATCH endpoint. GETting the DNS records in a zone works fine with a token, but it’s not terribly useful without the ability to make changes as well.

Same issue here - automated script used to update DNS records but recently started returning this error.

UPDATE: This was not a cloudflare issue for me. Turns out another part of my script that set the record ID as a variable failed.

I get the error mentioned in the OP if I hit the following endpoint with a token: PUT https://api.cloudflare.com/client/v4/zones/:zoneID/dns_records/ (note missing id paramter), but do not get the error if I hit PUT https://api.cloudflare.com/client/v4/zones/:zoneID/dns_records/:ID with a valid ID.

I rolled my token, input the new token into my script, and it works now. Weird. I’m going to mark this as solved, as it may have just been a temporary issue.

1 Like

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