Netlify-cli payload error for createDN

Hi there, I am seeing some odd behavior with netlify-cli when using the createDnsRecord. When I issue the following command

netlify api createDnsRecord --data '{ "zone_id":"5f0008300e71d0b6853aadd4","type": "ns","hostname": "myDomain.com","value": "12345670asjsdfRandpm","ttl": 60}'

I get the following error message JSONHTTPError: Unprocessable Entity

I’m not sure what is wrong with my payload, because I am able to create the resource when doing a curl command with the same payload

curl --location --request POST 'https://api.netlify.com/api/v1/dns_zones/5f0008300e71d0b6853aadd4/dns_records' \
--header 'Authorization: Bearer xxxxxxxxx \
--header 'Content-Type: application/json' \
--data-raw '{
  "type": "NS",
  "hostname": "myDomain.com",
  "value": "12345670asjsdfRandpm",
  "ttl": 60
}'

Any help would be greatly appriciatated.

Hi @sbUser, welcome to the community!

Is createDnsRecord the only one that you are seeing with that failure? Since the cli is open source, would you be willing to file the issue here: https://github.com/netlify/cli/issues?

Hi @Dennis You bet!

1 Like

I added a link to this post in the issue you created just to make it easier to refer to this post from that issue.