Edit User Role Assignment

To change a role, assigned to the user, add a new role (or set of roles), use the following request:

PUT /users/:id.xml
PUT /users/:id.json

XML Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<user><role_ids><role_id>1</role_id><role_id>2</role_id></role_ids></user>' --url http://onapp.test/users/9.xml

JSON Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"user":{role_ids:["3","1"]}}' --url http://onapp.test/users/9.json

Where:

role_ids – ID of role(s) you want to assign to the user 

 This returns an HTTP 204 response if roles are changed, or HTTP 404 if the specified role ID isn't found.