Programmatically create Netlify site, build, GitHub link, DNS and HTTPS

We use Netlify extensively for the deployment of web apps. Each new customer of ours gets a new site on a subdomain managed by a separate DNS services (AWS Route 53)
The sites are Vue apps and the build command that Netlify issues runs a JavaScript file that uses some configured environment variables to retrieve customer specific configuration from a Github repo, copies it into the file structure of the app and the runs the Vue CLI build command.
We then create a TXT entry in Route53 to allow Netlify to provision a Let’s Encrypt certificate.

This is all set up using the Netlify console but what we’d like to do is achieve the same programmatically because we want to provide our customers the facility to create and manage their own configuration.

I can see from the docs that there’s a Netlify CLI command for creating sites - netlify sites:create which sounds like a good start. What I’m wondering is, before we dive into this, is what I’m describing feasible with the Netlify CLI (or other API) tools? If it is and anyone has some examples of how they’ve achieved something similar, even better!


Hey @ross.coundon,

I can say that there have been users who have used this kind of a setup in the past.

For example here’s a guide on linking repos:

Also, I think this person (there are probably more) has achieved some similar results based on the threads I’ve engaged with them in the past:

Not sure if they’d be open for a conversation with you, but reading their (and other threads) gives you an idea probably?

Thank you @hrishikesh - I wasn’t aware of the ReST API, I’ll digest that and think about some more specific questions.