Last week, I worked on a SharePoint project where I received a requirement to automate the creation of a SharePoint Document Library. The client needed a solution to dynamically create a new SharePoint Document Library whenever a specific event occurred, without manually setting them up each time.
After researching, I found a solution: we can automatically use the Power Automate “Send an HTTP request to SharePoint” connector to create a SharePoint library.
In this tutorial, we will learn how to create a SharePoint document library in Power Automate. We will also cover how to create a folder and a file within the SharePoint document library using Power Automate.
Create a SharePoint Document Library in Power Automate
I will show you how to create a document library using Power Automate.
In Power Automate, we don’t have any direct action to create a document library, so I will use HTTP requests to create a SharePoint document library.
Now follow the below steps:
1. In the Power Automate, click the Instant Cloud flow, enter the Flow name, and choose the trigger flow (i.e., manually trigger a flow).

2. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:
- Site Address: Select the SharePoint site where you want the library to be created
- Method: Select “POST” as the method
- URI: Provide the below URI:
_api/web/lists/- Headers: Add a key-value pair:
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose- Body: Provide the below JSON format to specify the properties of the new SharePoint document library:
{
"__metadata": { "type": "SP.List" },
"BaseTemplate": 101,
"Title": "Finance Records",
"Description": "For managing financial documents"
}Replace “Finance Records” with your desired name for the SharePoint document library. The BaseTemplate value of 101 is for a custom list. You can use other templates, like 100, for a SharePoint list if needed.

Now, click Save and run the flow manually after it runs successfully. Go to the SharePoint site to see that the SharePoint document library has been created successfully.

Create Columns in SharePoint Document Library Using Power Automate
Suppose you are looking to create columns for a SharePoint document library using Power Automate. In that case, I’ve already written a complete tutorial on how to Create Different Columns in a SharePoint Library Using Power Automate.
Create a Folder in Document Library using Power Automate
For this example, I created a SharePoint document library called Corporate Projects.

I also created a SharePoint list called Project Tracker.

Each new project requires its own subfolder structure. Every time a new project is added to your project tracker (a SharePoint list), you need to create folders like Contracts, Designs, and Reports within a specific folder for that project. Creating these folders can be time-consuming, so I will show you how to create them using Power Automate.
Now follow the below steps:
1. Create an automated cloud flow. Give the flow name and select the trigger When an item is created. Also, provide the Site Address and List Name.

2. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:
- Site Address: Select the SharePoint site where is your library
- Method: Select “POST” as the method
- URI: Provide the below URI:
_api/web/GetFolderByServerRelativePath(decodedurl='YourLibraryName')/Folders- Headers: Add a key-value pair:
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verboseBody: Provide the below JSON format to specify the properties of creating the folder:
{
'__metadata': { 'type': 'SP.Folder' },
'ServerRelativeUrl': 'YourLibraryName/@{triggerBody()?['ProjectName']}'
}
3. Then again, add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:
- Site Address: Select the SharePoint site
- Method: Select “POST” as the method
- URI: Provide the below URI:
_api/web/GetFolderByServerRelativePath(decodedurl='YourLibraryName')/Folders- Headers: Add a key-value pair:
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verbose- Body: Provide the below JSON format to specify the properties of creating the folder:
{
'__metadata': { 'type': 'SP.Folder' },
'ServerRelativeUrl': 'YourLibraryName/@{triggerBody()?['ProjectName']}/Contracts'
}
In the same way add Send an HTTP request to SharePoint two times for Designs and Reports like the below screenshot:

Now click on Save, and to run the flow, create an item in the SharePoint list.

After the flow runs successfully, go to the SharePoint site and check the document library. You will see that the folder and subfolder have been created successfully.

Create a File in SharePoint Document Library Using Power Automate
In this example, I will show you how to create a file in the SharePoint document library using a Power Automate HTTP request.
Create an Instant clued flow, then add a Send an HTTP request to SharePoint action and Provide the below parameter:
- Site Address: Select the SharePoint site
- Method: Select “POST” as the method
- URI: Provide the below URI:
_api/web/GetFolderByServerRelativeUrl('YourLibraryName')/Files/add(url='YourFileName.extension',overwrite=true)- Headers: Add a key-value pair:
Accept: application/json;odata=verbose
Content-Type: application/json;odata=verboseIn my case, I want to create an Excel file, so give the URL Project Management Tasks.xlsx

Now, click Save and run the flow manually after it runs successfully. Go to the SharePoint site to see that the Excel file has been created successfully.

In this tutorial, I covered how to create a SharePoint document library using the “Send an HTTP request to SharePoint” action in Power Automate. We also explored creating folders and subfolders dynamically within a document library and learned how to create files within a SharePoint document library using Power Automate.
Related Power Automate articles:
- Update SharePoint List Items Based On Condition Using Power Automate
- Reassign An Approval Using Power Automate
- Create SharePoint List Using Power Automate
- Remove Line Breaks From Text in Power Automate
- Update SharePoint List Items Using Power Automate

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
Can any of these steps be used to create a new view in a current library? Looking for a way for a user to complete a simple form which will be used as the basis for setting up a new site page along with creating a new folder in the library. On the site page I’m hoping to include a library webpart which would be filtered to only show items with the project title. Hoping I’d be able to use power automate to create the filtered view.
For the columns, it’s kind of important to know the FieldTypeKind options:
https://learn.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.client.fieldtype?view=sharepoint-csom