We can organize our files in a SharePoint folder by using multiple files. For example, we can create different files for regions, months, years, or projects.
Sometimes, we may need to rename many files or folders when we work with them.
In this article, I will cover the following examples using the REST API validateUpdateListItem to rename SharePoint folders or files in Power Automate:
- How to rename a single SharePoint folder
- How to rename a single SharePoint file
- How to rename multiple files at once by adding prefixes or suffixes
Rename REST API Endpoint
Below is a REST API endpoint that I will use in the example:
_api/web/lists/GetbyTitle('<Document Library Name>')/items(<item-ID>)/validateUpdateListItem
Where:
- _api/web/lists: Refers to the site’s collection of lists (and libraries).
- GetByTitle(‘<Document Library Name>’): Calls the specific list or library whose title matches the one you provided.
- items(<item-ID>): We must pass the file or list ID.
- validateUpdateListItem: It updates a list item or document item using field values in a special format.
Rename SharePoint Document Library Folder Using REST API
I have a document library called “Product Approval” in the example below. There is a folder called Employee Leave Management with the item ID of 4. Check the screenshot below:

Here, I want to rename the folder name to Tsinfo Leave Management using REST API:
- Open the Power Automate Home page and choose Instant cloud flow with trigger Manually trigger a flow.
- Add the Send an HTTP request to SharePoint action and provide the following parameters:
- Site Address: Select the SharePoint Site Address from the dynamic content.
- Method: Select POST as the method
- Uri: Provide the below URI:
_api/web/lists/GetbyTitle('Product Approval')/items(4)/validateUpdateListItem
- Click on the Show all button to display all the Advanced parameters.
- Body:
{
"formValues": [
{
"FieldName": "FileLeafRef",
"FieldValue": "Tsinfo Leave Management"
}
]
}

- Now save the flow and run it manually.
- After the flow runs successfully, go to the SharePoint Document library. You can see that your folder name has changed.

You can rename the folder using the REST API in Power Automate.
Rename SharePoint File Using REST API with Power Automate
In the same document library, I want to check the file name Employee Leave Tracking to Leave Tracking File using REST API in Power Automate.
- Create an Instant cloud flow with a trigger (Manually trigger a flow).
- Add the Send an HTTP request to SharePoint action and provide the below required parameters:
- Site Address: Select the SharePoint Site Address where the document library is present.
- Method: Select POST as the method
- Uri: Provide the below URI:
_api/web/lists/GetbyTitle('Product Approval')/items(3)/validateUpdateListItem
Replace:
- Product Approval: Provide your library display name.
- 3: Provide the item ID.
- Click on the Show all button to display all the Advanced parameters.
- Body: Provide the below json part:
{
"formValues": [
{
"FieldName": "FileLeafRef",
"FieldValue": "Leave Tracking File"
}
]
}

- Now save the flow and run it manually. Next, click the Run Flow button. Once the flow runs successfully, go to the SharePoint library to check whether the file name has been renamed.

One interesting part is that if your file is open and you try to rename it, the name will change.
Rename Multiple Files Using REST API
Sometimes, you may have a need to add a prefix or a suffix to all the files in your Document library.
You can do this manually or one by one (using the methods shown above) if you only have a few files. But if you have many, this could take a lot of time.
In such a case, you can follow this example. I have a SharePoint document library called Certification Documents, which has 71 files. I want to add the prefix Tsinfo.

Below are the steps to rename multiple files:
- Use “Manually trigger a flow” (or scheduled/automated).
- Then add Get files (properties only) to get all files and provide the Site address and list name where the file is present.

- Add the ‘Apply to each’ control action, and in the ‘Select an output from previous steps’ section, provide the ‘Body’ value from the ‘Get files’ dynamic content.
outputs('Get_files_(properties_only)')?['body/value']

- Inside the Apply to each add the Send an HTTP request to SharePoint action and provide the below required parameters:
- Site Address: Select the SharePoint Site Address where the document library is present.
- Method: Select POST as the method
- Uri: Provide the below URI:
_api/web/lists/GetbyTitle('Certification Documents')/items(item()?['ID'])/validateUpdateListItem
- Click on the Show all button to display all the Advanced parameters.
- Body: Provide the below json part:
{
"formValues": [
{
"FieldName": "FileLeafRef",
"FieldValue": "Tsinfo item()?['{Name}']"
}
]
}

- Save the flow and run it manually. Once the flow runs successfully.
- Go to the SharePoint library. You can see that all the files have been renamed.

In the same way, you can rename the folder; you need to get the ID and provide the new name in the JSON section.
I hope you found this Power Automate REST API tutorial helpful for renaming a file or folder in a SharePoint document library.
If you want to rename the SharePoint list, check out the post “Rename SharePoint List Using Power Automate.”
You may also like the following Power Automate tutorials:
- Check If Field Is Blank in Power Automate
- What is Microsoft Power Pages
- Send Email Using REST API in Power Automate
- Check If an Input String Is an Integer Using Power Automate
- Delete Files From SharePoint Document Library Using Rest API

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.