POST /command/users/remove-roles
Remove roles from a user.
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:
user_id
: The ID of the user you want to remove roles from.role_ids
: An array of role IDs defining the roles that you want to remove from the user.
Example payload:
{ "user_id": <user-id>, "role_ids":[1,2,3] }
Example curl request:
curl -X POST "https://$(puppet config print server):4433/rbac-api/v1/command/users/remove-roles" \ -H "X-Authentication: $(puppet-access show)" \ -H "Content-type: application/json" \ -d '{"user_id": "c97c716a-5f42-49d8-b5a4-d0888a879d21", "role_ids": [1]}'
Response format
Returns 204 No Content if the user exists and the roles are successfully unassigned.
For errors, refer to RBAC service errors .