Set alias as primary domain via API

Hello,

Is it possible to set a custom domain / alias as a primary domain via Netlify API? Couldn’t found anything about this in the docs.

hi there, can you say a little more what you mean by ‘primary domain’? i want to make sure i understand correctly before i give advice, thanks!

Hi @Wdotis,

Are you wanting to add example.com as a custom domain with www.example.com and an alias to your reallycoolwebsite.netlify.app?

If so, yes, you can do this via the API. Try createDNSZone then createDNSRecord then configureDNSForSite then updateSite.

That’s what worked for me at least. :smiley: