Grant access to list item with Power Automate and REST API

How to grant access to a list item in a SharePoint Online list using a Power Automate flow.

Method

POST

URI

_api/web/lists/getbytitle('<List Title Here>')/items(<List Item ID Here>)/roleassignments/addroleassignment(principalid=<User ID Here>),roledefid=<Role Definition ID Here>

Headers

{
  "accept ": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body

None

Screenshot with example

Screen shot of Power Automate HTTP function.