createDnsRecord 401 using personal access token for zone in a Team

Hi,

I am able to call the below completely fine, and get a list of our DNS entries / records against a zone.
HTTP GET - https://api.netlify.com/api/v1/dns_zones/{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 - https://api.netlify.com/api/v1/dns_zones/{zoneId}/dns_records
With a body that looks like -
{
“type”: “NETLIFY”,
“hostname”: “abcde-testing.exampledomain.co.uk”,
“value”: “3.9.204.229”,
“ttl”: 3600,
“priority”: null,
“weight”: null,
“port”: null,
“flag”: null,
“tag”: null
}
or
{
“type”: “NETLIFY”,
“hostname”: “abcde-testing.exampledomain.co.uk”,
“value”: “3.9.204.229”,
“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,
Will

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!