Skip to main content

Remove members from a group

DELETE 

/groups/:groupName/members

Removes users from a group.

This DELETE requires a JSON request body and fails without one. The users to remove are named in the body, not in the URL; there is no DELETE /groups/{groupName}/members/{username} to call instead. A request sent with no body is refused with a 400 Invalid request body, and so is one whose body is empty or malformed. The body to send is {"users": ["jdoe"]}, with Content-Type: application/json.

A DELETE that carries a body is unusual, and tooling makes it easy to get wrong: many HTTP clients drop the body on a DELETE by default, and some generated SDKs will not send one at all. If this call keeps answering 400 with a URL you are sure of, check that your client is actually transmitting the body before looking anywhere else. With curl you need -X DELETE together with -d and an explicit -H 'Content-Type: application/json'.

This revokes AWS access. Everyone removed loses every permission set the group grants, immediately and without notice. Access they hold through a direct assignment or through another group is unaffected. Use GET /users/{username}/effective-assignments to see what a person is left with.

Identify users by their directory username, not their email address.

The response echoes your request, not the result. usersRemoved is the array you sent, returned verbatim, and count is its length. Note the key, since the POST on this path answers with usersAdded instead. Neither says which removals actually happened; confirm with GET /groups/{groupName}/members.

The operation is not atomic. Users are removed one at a time and the failures are collected and reported together at the end, so a 500 can mean some were removed and some were not. Re-sending the whole list is the usual way to recover.

A group name that matches nothing is a 500 here, not a 404, unlike GET on the same path.

A body of {} or {"users": null} is accepted rather than rejected: nothing is removed and the response is a 200 with usersRemoved: null and count: 0. That is the one case where sending a body but no users is not an error.

Request​

Responses​

The request was processed. Every name you sent is echoed back whether or not it was removed; see the note above.