Hi Wolfgang,
I located some information on this.
The patch user API is not the correct API to add the user to a group.
The correct API is: https://developer.genesys.cloud/devapps/api-explorer#post-api-v2-groups--groupId--members
The PATCH API will only edit the current information that this user already has, but it will not add them to any groups as there is a dedicated API for this function.
------------------------------
Lonny Schwartz
Principal PS Consultant
------------------------------
Original Message:
Sent: 04-14-2025 05:54
From: Wolfgang Liebich
Subject: Why is it impossible for me to change the group membership of a user via PATCH?
According to [PATCH /api/v2/users/{userId}](https://developer.genesys.cloud/useragentman/users/#patch-api-v2-users--userId-), it looks like it should be possible for me to change the group membership of a user by sending the appropriate "groups" array containing the names and types of the groups the agent should be a member of.
But when I try to change a user by using the API Explorer, I do not get any error, but also no effect - the PATCH-request has no request.
The request I send along looks like this (group names have been redacted):
{
"version": 73,
"groups": [
{
"type": "official",
"name": "group-name-redacted",
"visibility": "public",
"rulesVisible": true
}
]
}
I get back a result code of 200, but the group membership is not changed. This is the case both for existing and for new groups.
What is the problem with this approach, and is there any way to debug this by some kind of cloud audit log?
Thanks in advance,
Wolfgang Liebich
#Integrations
#PlatformAPI
#PlatformSDK
------------------------------
Wolfgang Liebich
Consultant
------------------------------