Hello,
I created a Power Automate flow that grants a user site collection administrator access to a SharePoint site. This works only if the account running the flow is already a site collection administrator of the site. If it is not, then I get something like the following:
{
"status": 403,
"message": "Attempted to perform an unauthorized operation.\r\nclientRequestId: ...\r\nserviceRequestId: ...",
"source": ".../_api/web/ensureuser",
"errors": [
"-2147024891",
"System.UnauthorizedAccessException"
]
}
It fails in the first 'Send an HTTP request to SharePoint' action.
Full flow:

The account is a SharePoint Administrator and is able to grant access to sites, it is not an admin of, using PowerShell just fine. Why is it failing when trying to grant access in a flow?