No longer able to update DNS records via API

While, listing DNS records of a zone worked, for example:
GET https://api.cloudflare.com/client/v4/zones/<my-zone-id>/dns_records/
will give me a JSON containing information of all DNS records in the zone.

But getting information of any specified DNS record fails, for example:
GET https://api.cloudflare.com/client/v4/zones/<my-zone-id>/dns_records/<my-dns-record-id>/
gives me ‘401 Unauthorized’.

And updating a DNS record doesn’t work with either PUT or PATCH methods:
PUT https://api.cloudflare.com/client/v4/zones/<my-zone-id>/dns_records/<my-dns-record-id>/
or
POST https://api.cloudflare.com/client/v4/zones/<my-zone-id>/dns_records/<my-dns-record-id>/
result in error ‘405: Method Not Allowed.’

The full command line I used to update DNS record is:

    	wget --no-verbose --inet4-only \
    		--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    		--header "Content-Type: application/json" \
   		--method PATCH \
    		"https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records/$CLOUDFLARE_DNS_RECORD_ID/" \
    		--body-data "{\"type\":\"A\",\"content\":\"$1\",\"proxied\":false}" \
    		--output-document -

I’m sure this API works on a few days early.

And I can also confirm the API token verification URL works:

$ wget --inet4-only --no-verbose --header "Authorization: Bearer <my-api-token>" --header "Content-Type: application/json" https://api.cloudflare.com/client/v4/user/tokens/verify --output-document -
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Cookie coming from api.cloudflare.com attempted to set domain to dash.cloudflare.com
{"result":{"id":"247b13d623488919122df69f3c13cc3f","status":"active"},"success":true,"errors":[],"messages":[{"code":10000,"message":"This API Token is valid and active","type":null}]}2020-01-21 02:54:36 URL:https://api.cloudflare.com/client/v4/user/tokens/verify [184] -> "-" [1]
3 Likes

I am using a script from https://github.com/gstuartj/cf-ddns.sh/ to update my IP on a daily basis.
Today I received an error message:
Record update failed. { "code": 1001, "error": "method_not_allowed" }

The script was running fine for the last 1-2 years.

I hav esimilar issues since today. I am using a Google Script to update DNS-Records and it was working fine at least until 18. of January. I did not change anything but now I am getting

{ "result": null, "success": false, "errors": [ { "code": 9021, "message": "Invalid TTL. Must be between 120 and 2,147,483,64....

and it I add “ttl” : “1” to my request it changes to

{ "result": null, "success": false, "errors": [ { "code": 1000, "message": "There was an unknown error." } ], "messag....

I am using Google’s UrlFetchApp…

Exactly the same problem. Since today 4:18am Berlin Time the script was unable to update the ip but it never got an error from the api. Only success has been logged by my script. :confused:

The error was reported at HTTP level, but it also responsed with a JSON that saying the same error message, shows by adding option --content-on-error to wget(1):

wget --inet4-only --header "Authorization: Bearer x" --header "Content-Type: application/json" --method PATCH https://api.cloudflare.com/client/v4/zones/x/dns_records/x/ --body-data '{"type":"A","content":"x","proxied":false}' --content-on-error --output-document -
--2020-01-21 09:08:11--  https://api.cloudflare.com/client/v4/zones/x/dns_records/x/
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving api.cloudflare.com (api.cloudflare.com)... 104.19.193.29, 104.19.192.29
Connecting to api.cloudflare.com (api.cloudflare.com)|104.19.193.29|:443... connected.
HTTP request sent, awaiting response... 405 Method Not Allowed
Saving to: 'STDOUT'

-                            [<=>                                ]       0  --.-KB/s               {
  "code": 1001,
  "error": "method_not_allowed"
}
-                            [ <=>                               ]      52  --.-KB/s    in 0s      

2020-01-21 09:08:13 ERROR 405: Method Not Allowed.

Yeah, same problem here.

I get this error message:
{"error": "Use of this API has been limited to the Cloudflare Dashboard."}
With "HTTP/1.1 401 Unauthorized, does someone know what is going on?

Same issue, unable to update DNS with script using API.

Funny, when updating DNS from different Zone I get {"code": 1000,"message": "There was an unknown error."}

Today, I found that the API method update DDNS is invalid. The error message is as follows:
“error”: “Use of this API has been limited to the Cloudflare Dashboard.”

Same here since today, i get this message:

“error”: “Use of this API has been limited to the Cloudflare Dashboard.”

Add me to the list. Happened to me yesterday, and i opened a support ticket, but just got their support-bot reply.

Can someone from CloudFlare actually look at this and explain why you disabled the APIs?

hi
stuck with same problem
but in my case, finally i was able to modify DNS through API

problem was in quotes near some parameters
if i do
,\"ttl\":\"1\",\"proxied\":\"$proxied\"
get an error

if i do without quotes - all works fine
here’s working curl request

zone_identifier="****************"
auth_email="[email protected]"
auth_key="**************"
record_identifier="**************"
record_name="sub.domain.com"
content="domain.com"
type="CNAME"
proxied="false"
curl -s -X PATCH  "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records/$record_identifier" \
-H "X-Auth-Email: $auth_email" \
-H "X-Auth-Key: $auth_key" \
-H "Content-Type: application/json" \
--data "{\"id\":\"$zone_identifier\",\"type\":\"$type\",\"name\":\"$record_name\",\"content\":\"$content\",\"ttl\":1,\"proxied\":$proxied}"

Modifying or adding a record works. It’s the GET or DELETE that seems to have been shut off

For me GET works but not PUT/PATCH methods.

For me GET method is working but PUT method is not working
This is working for me since 2019‑04 until today it’s not working anymore :confused:
Is Cloudflare change something about API?

1 Like

+1 Same for me.
I used to update A record through curl PUT for roughly one year but receive “Unknown error 1000” starting from 21/01 on. user2527’s suggested approach does not work for me, even leaving out the quotes I receive the error mentioned. Any help is greatly appreciated.

Hi @cloudflake, @tackleza, I suspect it’s the issue we’re seeing with the API that’s affecting you, Cloudflare Dashboard and Cloudflare API service issues. Sorry for the troubles, the team is on it.

Hi,

It’s not resolved.

Blockquote
2020-01-21 19:46:33,706 INFO Updating record: XXX proxied:False id:14c3xxxx…
2020-01-21 19:46:33,941 ERROR Request failed: {
“error”: “Use of this API has been limited to the Cloudflare Dashboard.”

Agreed. Not resolved.

Still not working :frowning: