Support Forums

Create site with API in custom team

We’re having trouble creating our sites via API in the correct team account. We use the netlify API to create and deploy sites as part of our backend review app process. We are using the API token generated from my account, and I think because of this it’s putting the newly created sites in my personal team (jake-dluhy) instead of our company team.

We tried adding account_slug: developers-xxxxxxx (where xxxxxxx is our slug suffix) to our request payload, but that didn’t change anything. I also switched my default account to our team account, and still no luck.

How do we designate which account to create a new site in via the API?


Heya @Jake_Dluhy_PP! As you’ve discovered that call will use your default team, rather than a specific team. Tokens have access to everything your login does, which, if you have more than one team, is all of the teams. There are some special cases around SSO-enabled teams vs API tokens, but I don’t think you’re in that position.

This is the appropriate API call to create a site on a specific team:

Please let me know how it goes!