Set alias as primary domain via API


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 as a custom domain with and an alias to your

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: