This web service updates a user's manually assigned groups.
This web service does not update user groups originating from a pre-authentication script.
- Setting groups with this web service overrides the groups previously assigned to the user. To retrieve the groups previously assigned to a user, use the Get a user's groups web service.
- Setting a group which did not previously exist automatically creates that group.
Method | Endpoint |
---|---|
PUT |
|
Path parameter | Type | Description |
---|---|---|
{userId} |
String | The user's identifier. See the List users or Search users web services to find a user's ID. It is also possible to get a user's ID from the Manage users menu. |
Request example
The following lines show an example of a JSON request body:
{
"manualGroups": [
"group10",
"group11"
]
}
Field | Type | Required? | Description |
---|---|---|---|
manualGroups |
Array | Yes | The groups to manually assign to the user. |
Return code | Description |
---|---|
200 OK |
The request is valid and returns data. |
400 BAD REQUEST |
The request is missing required parameters. |
401 UNAUTHORIZED |
The authorization header is absent or invalid. |
403 FORBIDDEN |
The user or API key does not have the ADMIN or USERS_ADMIN role. |
404 NOT FOUND |
No user exists with this ID. |
For a comprehensive list of all possible return codes, see Return codes.
Response body
The following lines show an example of a JSON response body:
{
"id": "a43eb18a-3f48-4732-9389-61b540ce9d0d",
"manualGroups": [
"group1"
],
"authenticationGroups": [
"group10",
"group11"
]
}
Field | Type | Description |
---|---|---|
id |
String | The user's identifier. |
manualGroups |
Array | The groups an administrator manually assigned to the user. |
authenticationGroups |
Array | The groups provided by the post-authentication script. |