SOLVED

How to create Team Site with REST API

%3CLINGO-SUB%20id%3D%22lingo-sub-269880%22%20slang%3D%22en-US%22%3EHow%20to%20create%20Team%20Site%20with%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-269880%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20been%20searching%20all%20over%20the%20place%20to%20find%20information%20about%20a%20%22simple%22%20task%20I%20want%20to%20do%20with%20REST%20API.%20I%20want%20to%20create%20a%20new%20Team%20Site...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20found%20this%20endpoint%20which%20lets%20me%20create%20a%20communication%20site%2C%20but%20why%20is%20there%20no%20such%20thing%20for%20Team%20Sites%3F%3C%2FP%3E%3CP%3E%22%2F_api%2Fsitepages%2Fcommunicationsite%2Fcreate%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-269880%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPIs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eprovisioning%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-269920%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20Team%20Site%20with%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-269920%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20quick%20response%20Kevin%2C%20it%20works%20like%20a%20charm!%3CBR%20%2F%3EI%20also%20wonder%20why%20this%20is%20so%20badly%20documented%2C%20since%20it's%20a%20basic%20operation%2C%20right%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-269913%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20Team%20Site%20with%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-269913%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Stefan%2C%20I%20spent%20ages%20digging%20around%20this%20as%20definitely%20isn't%20as%20simple%20as%20you'd%20think.%20Ultimately%20you%20need%20to%20use%26nbsp%3B%3CSPAN%3E_api%2FGroupSiteManager%2FCreateGroupEx%20but%20I%20covered%20some%20of%20the%20details%20in%20my%20post%20at%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.mcd79.com%2F2018%2F07%2F21%2Fexploring-creating-sharepoint-teamsites-using-sitedesign-and-the-rest-api.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.mcd79.com%2F2018%2F07%2F21%2Fexploring-creating-sharepoint-teamsites-using-sitedesign-and-the-rest-api.html%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-720377%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20create%20Team%20Site%20with%20REST%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-720377%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F226488%22%20target%3D%22_blank%22%3E%40Stefaan%20De%20Vreese%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3EYou%20can%20create%20a%20modern%20team%20site%20that's%20not%20connected%20to%20a%20group%20as%20well%20as%20a%20modern%20communication%20site%20via%20the%20REST%20APIs.%20Here's%20an%20example.%20The%20key%20on%20the%20left%20below%20is%20to%20set%20the%20web%20template%20to%20STS%233%20instead%20of%20the%20classic%20STS%230.%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F120615iE09E1324DE5C8040%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-06-25_14-18-47.png%22%20title%3D%222019-06-25_14-18-47.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional 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
Highlighted
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...

Highlighted
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?
Highlighted

@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