SOLVED

How to create Team Site with REST API

Brass Contributor

Hi Guys,

 

I have been searching all over the place to find information about a "simple" task I want to do with REST API. I want to create a new Team Site...

 

I have found this endpoint which lets me create a communication site, but why is there no such thing for Team Sites?

"/_api/sitepages/communicationsite/create"

 

 

3 Replies
best response confirmed by Stefaan De Vreese (Brass Contributor)
Solution

Hi Stefan, I spent ages digging around this as definitely isn't as simple as you'd think. Ultimately you need to use _api/GroupSiteManager/CreateGroupEx but I covered some of the details in my post at:

 

https://www.mcd79.com/2018/07/21/exploring-creating-sharepoint-teamsites-using-sitedesign-and-the-re...

Thanks for the quick response Kevin, it works like a charm!
I also wonder why this is so badly documented, since it's a basic operation, right?

@Stefaan De Vreese 

 

You can create a modern team site that's not connected to a group as well as a modern communication site via the REST APIs. Here's an example. The key on the left below is to set the web template to STS#3 instead of the classic STS#0.

2019-06-25_14-18-47.png

1 best response

Accepted Solutions
best response confirmed by Stefaan De Vreese (Brass Contributor)
Solution

Hi Stefan, I spent ages digging around this as definitely isn't as simple as you'd think. Ultimately you need to use _api/GroupSiteManager/CreateGroupEx but I covered some of the details in my post at:

 

https://www.mcd79.com/2018/07/21/exploring-creating-sharepoint-teamsites-using-sitedesign-and-the-re...

View solution in original post