web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power automate with Sh...
Power Automate
Unanswered

Power automate with SharePoint site collection

(0) ShareShare
ReportReport
Posted on by 23

a trying to use power automate to make a classic sharepoint site, i keep getting errors but only when i run the sts#0 template any advice?

"request": {

"Title": "@{triggerOutputs()?['body/Title']}",

"Url":"@{triggerOutputs()?['body/NewURL']}",

"Lcid": 1033, "ShareByEmailEnabled":false,

"Description":"@{triggerOutputs()?['body/Justification']}",

"WebTemplate":"sts#0",

"Owner":"SharePoint Service Administrator"

, "TimeZoneId":"@{variables('VarTimeZone')}" } }

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,755 Most Valuable Professional on at

    Hi @jasonskel199,

     

    Just to double check. Are you using the _api/SPSiteManager/create endpoint/URI for this?

    https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest

     

    If so, that endpoint is for the creation of modern sites. So, it might not even be supported to create classic sites with this endpoint. Worth double checking in the Microsoft documentation. 

     

    Out of interest, what are your specific requirements that you want to use a classic instead of a modern site?

  • eliotcole Profile Picture
    4,390 Moderator on at

    Hi, @jasonskel199, what @Expiscornovus said, but also ... take a look at your URI and ensure that any references (IDs, usually) are the right ones, and are URI encoded so that curly brackets { and apostrophes ' are their encoded equivalents.

  • jasonskel199 Profile Picture
    23 on at

    Hello,

    the error is my uri is "_api/SPSiteManager/create"
    i am getting a this error
    "status": 400,
    "message": "siteTemplate\r\nParameter name: Performing this operation on a site with this template is not allowed.\r\nclientRequestId: 4e66ddfc-4909-4afc-8113-cd7dfc33c9e4\r\nserviceRequestId: dda050a0-00b2-0000-1325-381ffb727328"

     

    My URI is "_api/SPSiteManager/create" and headers are 

    accept | application/json;odata.metadata=none
    Content-type| application/json
     
  • eliotcole Profile Picture
    4,390 Moderator on at

    OK, @jasonskel199, I think you really need to take another look at what @Expiscornovus said about this being specifically for a Modern SharePoint site.

     

    However, if you decide to make this for a Modern site, here's a few things you need to make sure of:

    1. If you are making a sub-site, make sure that the base site is the correct one.

    2. Make sure that it is a POST type of request.

    3. Make sure that you have an actual user in that Administrator field, like in the documented example. Your text above just has a few words.

      It should resemble "owner@yourtenant.onmicrosoft.com" or "person@domain.com" ...

    4. Double-check that your assembled JSON in the body field looks correct, as per the documentation.

      You may need to see a completed/failed run to inspect this.


    5. Make sure that you have the below header:
      Key Value
      odata-version 4.0
    6. Ensure that any dynamic data you are using as a value in the JSON body field is not breaking the request. Invalid values here will cause issues. 

    7. Check your privileges in the area of SharePoint that you're trying to create the site. Does your user have permissions to make the site?

    8. Ensure that the site structure (and permissions) allow you to create a classic site, it may be restricted within the SharePoint site makeup. Or you may not be allowed to create a classic site in a Hub site, for example.

    If you want to test that it works, just create a site with simple text in those fields (maybe test without that timezone field first) and  then remove the created sites afterwards.

     

    Also here's a few things to try (try different combinations, too) :

    1. Try removing the ";odata.metadata=none" and let us know if that helps.
    2. Try with and without ";odata=verbose" on both the 'Accept' and 'Content-type' header values.
    3. Try completely removing the Content-type header altogether, it's not specified in the spec.
    4. Last one, try removing the quotation marks around the dynamic data. Often flow will add those automatically, and it may be adding more than is required, which will invalidate the JSON.

    ---

     

    Finally, maybe take a look at this endpoint, perhaps it is more apt for your situation.

     

    In that it states to include the 'content-length' header, if you wish to do this, just create the body text in a previous step (Compose action or String variable) and use a length() expression to calculate how long it is in the value side.

     

    ---

    Also, not for nothing, regarding my 2nd point above, your JSON in your original post doesn't look quite right.

     

    What would really help us help you is if you could past a/some screenshot(s) of your flow from the edit screen (obfuscated where necessary), plus some sample data, too.

  • jasonskel199 Profile Picture
    23 on at

    I am able to create modern sites with this json, The timezone is because i work for an organization that spans over several countries, this is working fine for modern sites, my question is how do i use power automate to make a classic sharepoint site. 

  • eliotcole Profile Picture
    4,390 Moderator on at

    Have you tried the second endpoint that I suggested?

  • jasonskel199 Profile Picture
    23 on at

    wouldn't this endpoint only be for adding a subsite? /_api/web/webinfos/add

  • eliotcole Profile Picture
    4,390 Moderator on at

    What type of site are you trying to make, @jasonskel199?

     

    A hub-site? A root-site? A site-collection site? More?

  • jasonskel199 Profile Picture
    23 on at

    i am trying to make a classic teams site collection

  • eliotcole Profile Picture
    4,390 Moderator on at

    Excellent, and is to be at the root of the domain, or as a site on the root?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 103 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 87

#3
trice602 Profile Picture

trice602 63 Super User 2026 Season 1

Last 30 days Overall leaderboard