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 URL

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.