Remove Users from a Group (v2)
REST Resource
PUT /interop/rest/security/v2/groups/removeusersfromgroup
Table 2-36 Tasks for Remove Users from Group
| Task | Request | REST Resource |
|---|---|---|
| Remove users from group | PUT | /interop/rest/security/v2/groups/removeusersfromgroup |
Request
Supported Media Types: application/json
The following table summarizes the request parameters.
Table 2-37 Parameters
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
groupname |
The name of group from which the users must be removed. This group must be a pre-existing group. | Payload | Yes | None |
users |
List of userlogin IDs of the users to be removed from group. | Payload | Yes | None |
Example URL and Payload
https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup
{
"groupname": "G1",
"users": [
{
"userlogin": "jdoe"
},
{
"userlogin": "chris"
}
]
} Response
Supported Media Types: application/json
Table 2-38 Parameters
| Name | Description |
|---|---|
links |
Detailed information about the link and HTTP call type |
status |
Identifies the status of the operation
|
error |
Detailed information about the error |
details |
Detailed status of the operation performed. Total number of records processed, succeeded, and failed and reason for why it failed. |
Examples of Response Body
Example 1: Job Completes without Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup",
"action": "PUT"
},
"status": 0,
"error": null,
"details": {
"processed": 3,
"succeeded": 3,
"failed": 0,
"faileditems": null
}
} Example 2: Job Completes with Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup",
"action": "PUT"
},
"status": 1,
"error": {
"errorcode": "EPMCSS-21022",
"errormessage": "Failed to remove users from group. Group <groupname> does not exist. Provide a valid groupname."
},
"details": null
} Example 3: Job Completes with Partial Errors
{
"links": {
"href": "https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup",
"action": "PUT"
},
"status": 0,
"error": null,
"details": {
"processed": 5,
"succeeded": 3,
"failed": 2,
"faileditems":
[
{
"userlogin": "jdoe",
"errorcode": "EPMCSS-21032",
"errormessage": "Failed to remove user from group. User jdoe does not exist. Provide a valid userlogin."
},
{
"userlogin": "chris",
"errorcode": "EPMCSS-21032",
"errormessage": "Failed to remove user from group. User chris does not exist. Provide a valid userlogin."
}
]
}
} Sample cURL Command Basic Auth
curl -X PUT -s -u '<USERNAME>:<PASSWORD>' -H 'Content-Type: application/json' -d '{"groupname":"G1","users":[{"userlogin":"jdoe"},{"userlogin":"chris"}]}' 'https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup'
Sample cURL Command OAuth 2.0
curl -X PUT --header "Authorization: Bearer <OAUTH_ACCESS_TOKEN>" -H 'Content-Type: application/json' -d '{"groupname":"G1","users":[{"userlogin":"jdoe"},{"userlogin":"chris"}]}' 'https://<BASE-URL>/interop/rest/security/v2/groups/removeusersfromgroup'