Is it possible to create a site collection using the SharePoint Online REST api?

I found some old notes about using admin.asmx in 2007/2010/2013 but I can't find anything related to SharePoint online or if it still exists.

An example URL would be amazing if it's possible.

  • I've used the PnP library and Flows with Azure functions, but haven't explored the ReST route yet. I'm assuming it would be a lot easier than those 2 methods. Commented Dec 13, 2018 at 22:26
  • What type of site collection would you like to create ? Do you want to create modern communication and team sites ? Commented Dec 14, 2018 at 12:05

2 Answers 2


SharePoint Online Rest API provide endpoint to create a sub site but not site collection, see my reply in the similiar thread:

Create the site collection using ECMAScript, JSOM Or Rest API

And web service http://CentralAdmin/_vti_adm/Admin.asmx is not suitable for SharePoint Online, as there is no CA for SPO, this is for On-Premise Environment.

You could use PnP PowerShell New-PnPSite Command to create a site collection instead:



Its possible to create Site collection using the Rest API.

Here is the code for Site Collection if you want to create a Communication Site collection in Tenant.

var body={
        "Description":"Here is my communication site",
        // "SiteDesignId" - use either of the below 3 options
        "Title":"My Test Communication Site",

    type: "POST",
    url: "https://tenantname.sharepoint.com/_api/sitepages/communicationsite/create",
    contentType: "application/json",
    processData: false,
    data: JSON.stringify(body),
        "X-RequestDigest": document.getElementById("__REQUESTDIGEST").value
    success: function () {
        console.log("creation request submitted");
    error: function(data){

Hope this code helps.

ref: https://gautamdsheth.wordpress.com/2017/10/04/spo-create-communication-sites-using-rest-api/

Here is the code i have got from MS for Subsite.

function createSite() {

        var newSiteTitle = "Site Title Test";

        var newSiteDesc = "Site Title Desc";

        var newSiteUrl = newSiteTitle.replace(/\s/g, "");

        var siteUrl = _spPageContextInfo.webAbsoluteUrl;

        var fullUrl = siteUrl + "/_api/web/webinfos/add";


            url: fullUrl,

            type: "POST",

            data: JSON.stringify({

                'parameters': {

                    '__metadata': { 'type': 'SP.WebInfoCreationInformation' },

                    'Url': newSiteUrl,

                    'Title': newSiteTitle,

                    'Description': newSiteDesc,

                    'Language': 1033,

                    'WebTemplate': 'sts#0',

                    'UseUniquePermissions': false



            headers: {

                "accept": "application/json;odata=verbose",

                "content-type": "application/json;odata=verbose",

                "X-RequestDigest": $("#__REQUESTDIGEST").val()


            success: onQuerySucceeded,

            error: onQueryFailed



    function onQuerySucceeded() {

       alert("Site Created Successfully!");


    function onQueryFailed(sender, args) {



ref link :https://social.technet.microsoft.com/wiki/contents/articles/37458.sharepoint-online-office-365-create-site-using-rest-api.aspx

  • 2
    This will create a subsite - not a site collection Commented Dec 14, 2018 at 7:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.