I'm trying to create a new site collection in sharepoint 2019 with the api _api/SPSiteManager/create. The only template i can choose are STS#3 and SITEPUBLISHING#0. If I choose any other template it will tell me :

"Performing this operation on a site with this template is not allowed."

Is there a way to create a new site collection with a custom template via api?

  • How you have created custom template ? it's using Site Definition concept (Farm Solution) or you are using Web Template (using Sandbox solution)? Mar 1 at 7:11
  • I have an exported custom template that is a WebTemplate, it's a .wsp file.
    – forsus
    Mar 1 at 14:31
  • How you are using API? I meant using C# code or using any other approach? Mar 2 at 4:26
  • I'am using curl and javascript
    – forsus
    Mar 2 at 10:31
  • I've managed to create a sitecollection with a custom Template, for everyone interested: this can't be done via client side api but only from the server side. I've created a Console Application in Visual Studio with this code: link
    – forsus
    Mar 8 at 9:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.