web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Transfer a User from O...
Power Automate
Answered

Transfer a User from One SP User Group to Another using REST API

(0) ShareShare
ReportReport
Posted on by 1,360

Hello,
Is it possilble to move a person from one SP user group to another user group.
Lets say a user is in a "Read" only group but the manger wants to put them in a "Contributor" group?
This would need to be automated using REST. 
A manager would input the instruction on a SP list form triggering the workflow to do the heavy lifting.

Categories:
I have the same question (0)
  • Verified answer
    eliotcole Profile Picture
    4,390 Moderator on at

    Hi, @golfnutt82 , I appreciate that you may have legacy SP groups and users, and there's definitely ways there too ... but have you looked at the Office 365 Groups actions?

     

    If the users are all 365 groups members (which all modern SP / Teams groups are) then you can accomplish what you want using the "Remove member from group" and "Add member to group" actions therein.

     

    I appreciate that you mentioned that you would like this to react to changes made by a manager on a SharePoint list's form input (that's just going to be a new/amended SP list trigger if that's it) but then you also said that you wanted this to be REST, too.

     

    So if you *also* want to make this REST compatible, after testing it using a flow button or reacting to test entries on the list in question, you can change the trigger to an HTTP Request. For which you'll need to feed it the right input. But once you have that it will mean that you can then have a separate flow that simply calls the HTTP Request.

     

    Responses can also be added for even more full REST compatibility.

     

    However, like I say, if you just want it to react to the input on a SharePoint list, then make the trigger one of either SharePoint triggers "When an item is created" or "When an item is created or modified" and it'll fire accordingly.

     

    EDIT - The following questions are important to discern if you're doing this for the user groups defined in SP Sites:

    1. Do you already have access to the specific SP.Group user group Title and/or Id that you wish to remove from and add to?
      ie. have you already extracted / automated this information for the form that is affecting the changes?
    2. Do you already have access to the specific SP.User and their LoginName that you wish to remove from and add to?
    3. If either of those isn't quite set up, yet. Are you trying to basically build a user management app? 

    If the answer to that third question is "yes" I'm sure someone around here might be kind enough to help do the whole thing for you. However, and I say this with kindness, you will almost definitely be more rewarded finding someone in your company that could build this for you. As there is almost definitely someone doing a low level job that could.

     

    Still, if you just wish to add and remove users to and from a group with HTTP calls, use the setups below, where:

    _GROUP_ID_ =The Id of the SP.Group user group
    _USER_LOGINNAME_=The LoginName of the SP.User user
    _USER_EMAILADDR_=The Email of the SP.User user

     

    To add a user:

    Method POST
    URI /_api/web/sitegroups/GetById("_GROUP_ID_")/users
    Headers
    KeyValue
    Acceptapplication/json;odata=verbose
    Content-Typeapplication/json;odata=verbose
    X-RequestDigest$("#__REQUESTDIGEST").val()
    BODY

    {

      "__metadata": {

        "type": "SP.User"

       },

     "LoginName": "_USER_LOGINNAME_"

    }

     

    To remove a user:

    Method POST
    URI /_api/web/sitegroups/GetById("_GROUP_ID_")/users/getbyemail('_USER_EMAILADDR_')
    Headers
    KeyValue
    Acceptapplication/json;odata=verbose
    Content-Typeapplication/json;odata=verbose
    IF-MATCH*
    X-HTTP-MethodDELETE
    X-RequestDigest$("#__REQUESTDIGEST").val()
    BODY 

     

    If you want to do any more, I would suggest perhaps reading the SharePoint REST documentation online, there is quite a bit, there is also the Graph docs, too.


    To be completely honest with you, that's how I have provided the above, along with some internet searching based on that.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard