Organizations often need to provision new SharePoint subsites in a consistent way. Instead of creating them manually, it is possible to automate the process using Power Automate combined with the SharePoint REST API.
🚀 Automating SharePoint Subsite Creation with Power Automate and REST API
📌 Introduction
Organizations often need to provision new SharePoint subsites in a consistent way. Instead of creating them manually, it is possible to automate the process using Power Automate combined with the SharePoint REST API.
This approach allows you to reference an existing site template (previously published in the tenant) and create subsites on demand.
⚙️ Step 1 – Store the Template Reference
In Power Automate, the first step is to store the template reference in a variable.
Example:
- Variable Name:
Template - Value:
{11111111-2222-3333-4444-555555555555}#ContosoTemplate
This value contains:
- A GUID → internal identifier of the template registered in the tenant.
- A logical name after the hash → for example,
ContosoTemplate.
⚠️ Important: This template must have been previously created in SharePoint (via Admin Center or PowerShell).
⚙️ Step 2 – Send an HTTP Request to SharePoint
Next, we call the SharePoint REST API to create the subsite.
- Method:
POST - Uri:
/_api/web/webinfos/add - Headers:
Accept: application/json;odata=verbose Content-Type: application/json;odata=verbose - Body Example:
{ "parameters": { "__metadata": { "type": "SP.WebInfoCreationInformation" }, "Url": "DemoSubsite", "Title": "Contoso Business Unit", "Description": "Automatically created site", "Language": "1033", "WebTemplate": "{11111111-2222-3333-4444-555555555555}#ContosoTemplate", "UseUniquePermissions": false } }
⚙️ What Happens Behind the Scenes
- Power Automate prepares the values for the new subsite (URL, Title, Description, etc.).
- The template reference (
strTemplate) is injected into the request. - SharePoint creates the new subsite based on the published template.
✅ Key Takeaways
- The GUID + template name refers to a Site Design previously registered in the tenant.
- The endpoint
/_api/web/webinfos/addis used for subsite creation. - This approach is suitable for automation but depends on templates being defined in advance.
- If you need to clone an entire site dynamically, other approaches (such as custom provisioning via Azure Functions or PnP Framework) may be better suited.
