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

**URL:** <https://answers.netlify.com/t/programmatically-create-netlify-site-build-github-link-dns-and-https/51319>\
**Category:** Support\
**Tags:** netlify-cli, building, netlify-dns-https-ssl, deployment\
**Created:** [February 3, 2022, 10:59am UTC](https://answers.netlify.com/t/programmatically-create-netlify-site-build-github-link-dns-and-https/51319 "2022-02-03T10:59:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ross.coundon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ross.coundon/32/1448_2.png) [@ross.coundon](https://answers.netlify.com/u/ross.coundon)\
**Post date:** [February 3, 2022, 10:59am UTC](https://answers.netlify.com/t/programmatically-create-netlify-site-build-github-link-dns-and-https/51319/1 "2022-02-03T10:59:34Z")

</div>

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!

Thanks

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [February 3, 2022, 1:27pm UTC](https://answers.netlify.com/t/programmatically-create-netlify-site-build-github-link-dns-and-https/51319/2 "2022-02-03T13:27:48Z")

</div>

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:

> [@\[Support Guide\] Linking a repository via API](https://answers.netlify.com/t/support-guide-linking-a-repository-via-api/121/):
>
> Last reviewed by Netlify Support Staff: August 2023 It is easiest to link a repository in Netlify’s UI; doing it via API is challenging and should be a rare use case. Nonetheless, it is possible to create a Netlify site linked to a repository at any of our supported git providers programatically. Specifically, it is possible to use Netlify’s REST API for these situations. You’ll probably be interested in the general topics around “how do I use Netlify’s REST API?” (see [this support guide](https://answers.netlify.com/t/support-guide-understanding-and-using-netlifys-api/160), as w…

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:

> **[@GonzaloHirschToptal](https://answers.netlify.com/u/gonzalohirschtoptal/activity/topics)**

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

---

<div class="post-metadata">

**Author:** ![ross.coundon](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/ross.coundon/32/1448_2.png) [@ross.coundon](https://answers.netlify.com/u/ross.coundon)\
**Post date:** [February 4, 2022, 10:26am UTC](https://answers.netlify.com/t/programmatically-create-netlify-site-build-github-link-dns-and-https/51319/3 "2022-02-04T10:26:19Z")

</div>

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