POST /command/roles/remove-users

Remove a role from one or more users.

Request format

When Forming RBAC API requests to this endpoint, the content type is application/json. The body must be a JSON object using the following keys:

  • role_id: The ID of the role you want to remove users from.
  • user_ids: An array of user IDs defining the users that you want to remove from the role.

Example payload:

{ "role_id": <role_id>, "user_ids": [<user_id1>, <user_id2>, <user_id3>, ...]}

Example curl request:

curl -X POST "https://$(puppet config print server):4433/rbac-api/v1/command/roles/remove-users" \
-H "X-Authentication:$(puppet-access show)"  \
-H "Content-type: application/json" \
-d '{"role_id": 1, "user_ids": ["5c1ab4b0-588b-11e4-8ed6-0800200c9a66"]}'

Response format

Returns 204 No Content if the users are removed from the role.

A request with an invalid role_id still returns 204 No Content even though no users were removed from the nonexistent role.

Returns 400 Bad request if a user doesn't exist.

For other errors, refer to RBAC service errors .