SOLVED Permission denied (error 10000) when using the API to add a new DNS record

I’m trying to add DNS records to my Cloudflare domain using Terraform, specifically A and AAAA records. I get an authentication error when I try to do this.

Even more troubling, even trying to list the existing DNS records (api.cloudflare.com/client/v4/zones/{zone_id}/dns_records) for my zone fails with a 10000 “Authentication error”.

What I’ve tried:

  • using the global API key (two headers get added to the API request)
  • creating an API token that has permission to edit DNS records (one header gets added to the API request)

Neither work. Both approaches give an authentication error. For the second approach, I can confirm that the token is active (indeed, I can even use the API to confirm that it’s active).

I can manually add DNS records in the dashboard. That works just fine. It’s just that using an automated approach using the API doesn’t work.

Is it possible that working with the API in this way for my domain (whose TLD is .qa) is not supported? In other words, maybe everything would work if I were to use .com (or some other major TLD)? I thought I saw some discussion somewhere saying that not every TLD is supported via the API (at least, not 100%).

Nevermind – I was using the wrong zone ID. Silly mistake on my part; sorry for the noise.

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