UnauthorizedAccessException calling REST API from Workflow when trying to create subsite


  • Scenario
    I want to create a workflow in Sharepoint Online that creates a subsite through REST call. The Workflow is started from : 
    and should create subsites under subsite1 for example :

    I created a workflow that calls "_api/web/webinfos/add" and enabled app permissions on the site.

    Error message
    {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"sv-SE","value":"Access denied. You do not have permission to perform this action or access this resource."}}} (translated from English to Swedish)

    Any ideas? Could I have setup the app permissions wrong?

    Monday, January 2, 2017 12:54 PM

All replies

  • Hi,

    Firstly, please check if the sub site has been created successfully, even if you have received an error.

    Please make sure that the Call HTTP Web Service step is added in App Step.

    Please refer to the following article, check if you have set app permission correctly:

    Detailed steps about how to create sub site via designer workflow for your reference:


    Dean Wang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Tuesday, January 3, 2017 8:48 AM
  • Hi Dean and thanks for your help.

    No subsite is created and the call is made in an App Step.

    I have followed the steps from your link with no success I still get the same UnauthorizedAccessException error

    The App permissions is setup as follows:

         <AppPermissionRequest Scope="" Right="FullControl"/>

    The Workflow is running from the Project site and the subsite should be created under Project.

    Any idea?

    Tuesday, January 3, 2017 12:39 PM