I try to create a new site with a post request using: POST https://api.netlify.com/api/v1/sites
with body:
{
"name": "whateversitename"
}
I get a new site, but with a random name.
If I try to update the site using: PATCH https://api.netlify.com/api/v1/sites/<site-id>
with body:
{
"name": "whateversitename"
}
And I get a 200 back, but not a name change.
I even tried with body:
{
"name": "whateversitename",
"url": "http://whateversitename.netlify.app",
"admin_url": "https://app.netlify.com/sites/whateversitename",
"ssl_url": "https://whateversitename.netlify.app"
}
but nothing happens!
How can I rename a site using the API, or directly create a correctly named site?