As we all know, Flow is a replacement for SharePoint Designer based workflows. In my one of the latest assignments I had a requirement to update (or) add the user to the SharePoint groups, but by default we do not have any connectors to do this. Hence, in order to achieve this we shall use the send HTTP request to SharePoint connector and pass the rest endpoint URL and its required parameters.
Here is the step by step approach:
Step 1
Navigate to your flows, click on add action, and choose the “Send HTTP request to SharePoint”. You can also search for this in the search box below or click on SharePoint to choose this action.

Step 2
Pass the required parameters,

Select the site where you want to add the users.
Method
POST, the method should post since we are adding the user.
Uri
_api/web/sitegroups(43)/users, this is the typical REST Endpoint URL to fetch the users from the particular group. Here (43) is the group ID. We shall not use the group name here we can only use the group id.
Headers

- {“_metadata”:{“type”:”SP.User”},”LoginName”:”xyz”}
In place of xxxx, you shall replace it with your required name, you shall also use any of the people picker field names in place of XYZ.
Save the flow and test it; your users now should have been added to the group.
Nilanka PereraPosted Apr 2, 2020, 4:28 AM
This is what worked for me: Set the URL of the SiteSet method to “POST” URI set to “_api/web/sitegroups({GROUPID})/users”, example: _api/web/sitegroups(10)/users Add header with key=”accept” and value = “application/json;odata.metadata=none” Add header with key =”content-type” and value = “application/json” Set the Body to be {‘LoginName’:’i:0#.f|membership|[EMAIL ADDRESS]’}, example: {‘LoginName’:’i:0#.f|membership|[email protected]’}
Jaipal SinghPosted Jun 26, 2019, 4:19 PM
Hi - newbie to Sharepoint online and struggling on how to enter the values in the 'headers' input box. Is there some kind of special entry format?? Thanks
Valdo GjonikajPosted Apr 3, 2019, 4:16 AM
Hi, i'm getting the error:{ "Invalid JSON. The property name '' is not valid. The name of a property cannot be empty.}, i don't know how to except it.
Sumit PrustyPosted Jan 9, 2019, 12:54 AM
Hi i am getting the following error while implementing the same functionality of adding an user to a sharepoint group. "The property '_metadata' does not exist on type 'SP.User'. Make sure to only use property names that are defined by the type. "