Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  ALL Role and Permission removal from a user by API

    Posted 5 hours ago

    Dear all,

    I try to remove ALL permission roles from a user using a data action, though it seems that the PUT /api/v2/users/{subjectId}/roles, which sets the user's roles, does not allow a blank input. Is it possible to remove all roles using an API ? It's possible using the users GUI via the user management > Users interface.

    we would like t automate the removal of all roles when a user has been inactive for over 30 days.


    #PlatformAPI

    ------------------------------
    Ruud Reinold
    BNP Paribas Personal Finance UK
    ------------------------------


  • 2.  RE: ALL Role and Permission removal from a user by API

    Posted 4 hours ago

    In addition to the above, when all role's and permissions are removed the get /api/v2/users/{subjectId}/roles throws a 404 error:

    { "message": "No such user 73123f82-452a-49b5-97ad-64ed7bd9a9e4", "code": "not.found", "status": 404, "messageWithParams": "No such user {userId}", "messageParams": { "userId": "73123f82-452a-49b5-97ad-64ed7bd9a9e4" }, "contextId": "fd1243cd-185c-492e-bd11-6722d733e571", "details": [], "errors": [] }

    However, I would expect an output like: "roles": [], "permissions": [], "permissionPolicies": []



    ------------------------------
    Ruud Reinold
    BNP Paribas Personal Finance UK
    ------------------------------



  • 3.  RE: ALL Role and Permission removal from a user by API

    Posted 4 hours ago

    Hi Rudy, 

    If your goal is to automatically remove all access after 30 days of inactivity, the better option is to update the user to inactive through the Users API. Making the user inactive removes their access and is the supported method for this type of offboarding scenario.

    This removes all roles from the user as well as makes them inactive on the platform >  PATCH /api/v2/users/{userId}



    ------------------------------
    Josh Coyle
    Senior Professional Services Consultant
    ------------------------------