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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove folder permissi...
Power Automate
Unanswered

Remove folder permission using HTTP

(0) ShareShare
ReportReport
Posted on by 245

Hi,

I am trying to remove permission from a folder in document library using HTTP.  I have tried these two commands.

 

_api/web/GetFolderByServerRelativeUrl('url')/ListItemAllFields/breakroleinheritance(true)

_api/web/GetFolderByServerRelativeUrl('url')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)

 

 But the flow is keep running and its showing retries and in the end it says bad gateway. I am putting the URL of a folder in a string variable and then passing it in the flow.

Folder URLFolder URL

Screenshot_1.png

Each user has their own folder and folders are created on runtime. My requirement is to remove all permission on a folder and then assign the relevant user to it.

Categories:
I have the same question (0)
  • Brad_Groux Profile Picture
    4,556 on at

    Bad gateway errors are generally a communication error. You may want to review your syntax - Working with folders and files with REST | Microsoft Docs. Have you tried verifying your URI syntax via an API test call?

    I always verify my API calls in VS Code with the REST Client Extension before adding them to a Flow. Also, the run error messages should give you some further insights of where the issue lies.

    If you could provide an expanded screenshot of your Flow and steps, your Flow run history, and of any detailed error messages you're receiving we could likely better assist you. Also, for the best results, you may want to review How to write a good forum post.

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE. Want to know more? Follow @BradGroux on Twitter, and check out my Medium blog at https://msft.engineer.

     

  • Ramiz Profile Picture
    245 on at

    @Brad_Groux  Thanks for your answer. I will verify the api call but I would like to know is this the correct api for breaking inheritance of folders in document library?

     

     

    _api/web/GetFolderByServerRelativeUrl('url')/ListItemAllFields/breakroleinheritance(true)
    
    _api/web/GetFolderByServerRelativeUrl('url')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=true,clearSubscopes=true)

    Here is the error description.
    Screenshot_1.png

  • Brad_Groux Profile Picture
    4,556 on at
    /_api/web/GetFolderByServerRelativeUrl('"+folderRelativeUrl+"')/ListItemAllFields/breakroleinheritance(true)

    Yes, that is the correct syntax according to the SharePoint REST API documentation

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE. Want to know more? Follow @BradGroux on Twitter, and check out my Medium blog at https://msft.engineer.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard