You can assign permissions to SharePoint group using SharePoint REST API like:
function setPermissionForGroup(){
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/roleassignments/addroleassignment(principalid=<GroupId>, roledefid=1073741827)",
type: "POST",
contentType: "application/json;odata=verbose",
headers: { "Accept": "application/json; odata=verbose","X-RequestDigest": $("#__REQUESTDIGEST").val(),"X-HTTP-Method": "POST" },
success: function (data) {
alert('Contribute permission set on group');
},
error: function (data) {
alert("Error: " + JSON.stringify(data));
}
});
});
Replace <GroupId>
with the ID of SharePoint group. Open the SharePoint group & you will find the group ID in browser URL:
roledefid
for Permission Levels are as follows:
1073741829: Full Control
Full Control: 10737418291073741827: Contribute
Design: 10737418281073741826: Read
Edit: 1073741830- Contribute: 1073741827
- Read: 1073741826
- Limited Access: 1073741825
- View Only: 1073741924
You need to convert above REST call in Power Automate Send an HTTP request to SharePoint action.