I'm trying to replace a single user's group with a completely new set of groups. I am able to add user to a group and remove user from a group with https://docs.wso2.com/display/IS570/apidocs/SCIM2-endpoints/#!/operations#GroupsEndpoint#patchGroup API.
However, I want to completely replace the groups entirely with a new array, so I don't have to individually add/remove user from each group. I have tried using the following request
POST {url}/scim2/Users/{groupID}
with the following POST body
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "replace",
"value": {
"groups": [
{
"display": "group1",
"value": "092555e8-1636-4642-924e-27aef49757fe"
},
{
"display": "group2",
"value": "b0d42429-67e2-4447-9846-2b001add431f"
}
]
}
}
]
}
However, the response returned was
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:Error"
],
"detail": "Error in performing the add operation",
"status": "500"
}
How can I achieve this?