Getting records via the API GET …/dns_records does not return all records that I can see in the web-ui and get via an export. I’ve just noticed it for A-records (might be because that’s what I have most of e.g. if a certain amount of records triggers some bug) but not checked other record types.
Example:
% /usr/bin/curl -s -H "Authorization: Bearer MYAPITOKEN" -H "Content-Type: application/json" -X GET "https://api.cloudflare.com/client/v4/zones/MYZONEID/dns_records/export" | grep -E 'kia.*\sIN\s+A'
kia-apinet.axnet.nu. 3600 IN A 10.46.255.249
kia.axnet.nu. 1 IN A somepublicipaddr
kia-int.axnet.nu. 3600 IN A 10.46.254.2
kia-mc.axnet.nu. 3600 IN A 10.46.255.253
kia-unity.axnet.nu. 3600 IN A 10.45.46.97
kia-vr.axnet.nu. 3600 IN A 10.46.255.201
kia-wg.axnet.nu. 3600 IN A 10.46.255.1
kia-wifi.axnet.nu. 3600 IN A 10.46.254.129
whilst a successful response for
/usr/bin/curl -s -H "Authorization: Bearer MYAPITOKEN" -H "Content-Type: application/json" -X GET "https://api.cloudflare.com/client/v4/zones/MYZONEID/dns_records?type=A"
does not contain any of the above listed A-records, grepping for kia in the JSON output there isn’t one single instance containing that … but other A-records defined the same way, just with a different name are in there …