createDnsRecord 401 using personal access token for zone in a Team


I am able to call the below completely fine, and get a list of our DNS entries / records against a zone.
HTTP GET -{zoneId}/dns_records

However when calling trying to create a record using the below I get a 401 error, with the message ‘access denied’, using the same auth & personal access token as I do for the above GET which works fine -
HTTP POST -{zoneId}/dns_records
With a body that looks like -
“type”: “NETLIFY”,
“hostname”: “”,
“value”: “”,
“ttl”: 3600,
“priority”: null,
“weight”: null,
“port”: null,
“flag”: null,
“tag”: null
“type”: “NETLIFY”,
“hostname”: “”,
“value”: “”,
“ttl”: 3600,
“priority”: 0,
“weight”: 0,
“port”: 0,
“flag”: 0,
“tag”: “”

The DNS Zone is in a team I am part of, which I can list the entries of fine.

It has me a bit worried its not supported, as theres a custom endpoint for creating sites in teams createSiteInTeam (Netlify API documentation)

However there’s no such documented equivalent for createDnsRecord Netlify API documentation

Please can anyone see where I am going wrong, or is this not supported?

Zone Id is 5c98ef1be60e8056e2dc54cc

Many Thanks,

I think it’s the type NETLIFY that’s causing us to return 401. Have you tried other types?

That was it, type of ‘A’ worked great! Thank you!

thanks for coming back and sharing your solution!