Thank you for the idea, I’ve tried this code and did successfully get a 200 response; however, this didn’t actually add the user to the role so unfortunately didn’t achieve what I am trying to do.
Ideally trying to have a API call that I can add and/or remove people from roles.
Also odd that when I now run a call to get the role, it seems the Identity is there but the object looks empty. Nothing in the UI to imply the user has the role either? Maybe I need to wait a while for it to update or something?
Using the replace syntax did work in the end, the UI took quite long time to reflect the change… Which is a real shame because it delays access management.
However, the replace operation isn’t quite what I’m after, I’m trying to remove or add people to the list.
Even when I change the ‘replace’ op to ‘add’, it still seems to replace the identities… Any ideas on how to do an add or remove rather than a full replace?
Thanks Tyler, this is exactly what I was after. Looks like I needed to update my path and add an additional curly bracket inside of the value to get a 200 response.
The duplicates should not be allowed. I will raise a ticket with the team to dig into that further.
To remove you must know the index at which the identity you want to remove is at. For example, if you wanted to remove the first identity in the list, you could use the patch structure below.
Thank you for this, I can confirm this has worked and successfully removed the user.
Do you know if the pathing is limited via hardcoding to the position of the identity in the list? For example, say if I have 50 users and would like to remove an identity. Would I need to identify the position they appear against the role? EG: /membership/identities/23
Additionally, I have noticed that when we add users to the list using ID, when I get info about the role, they appear in the response but not in the UI?
Let’s say you have 4 people / identities (below) who is a member of a particular role.
[ z, x, c, v ]
You want to remove c from the list, so that’s index 2.
However, in the time between you getting the list and the time you submit a request to remove index item 2, member “z” is revoked from the role due to say, offboarding, immediate termination, role request expiry date reached…etc.
So the list is now:
[ x, c, v]
But your request of move index item 2 just reached ISC…so it removed “v”.
Not the same API, but when I remove users from arrays like this using PATCH operations against the CyberArk SCIM API I’ve been able to do something like
Maybe I’m just uninformed, but when I look at this use case, I wonder why access requests aren’t being used to fulfill this? Isn’t that essentially what we’re doing?
Potentially to bypass access request approvals if the role membership is being system-managed in this instance / use case, while still maintaining the approval scheme if the request was submitted via access request interactively.