Set user role in customer context
Handler: SetUserRole → SetUserRoleSrv / executeSetUserRole. Upserts the user's single role for a customer (updates existing customer role link or creates one). Body uses customer_id + role_basename; path {id} is the target user_id.
Authorization
bearerAuth In: header
Path Parameters
Target user ID
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
models.SetUserRoleInput (user_id comes from path, not body)
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/role" \ -H "Content-Type: application/json" \ -d '{ "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e", "role_basename": "string" }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"role_id": "ac4e70c8-d5be-48af-93eb-760f58fc91a9",
"created_at": "2019-08-24T14:15:22Z",
"created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
"modified_at": "2019-08-24T14:15:22Z",
"modified_by": "e8d4374d-93a1-4e98-a6c6-fdcf00c5059f",
"active": true,
"metadata": {}
}{
"status": 400,
"message": "Role name cannot be empty"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "Forbidden"
}{
"status": 404,
"message": "Role not found"
}{
"status": 500,
"message": "server_error"
}Handler: UpdateUserRole → UpdateUserRoleSrv. Updates user_id and/or role_id on the link.
Deletes a user-role assignment and responds 204 No Content. Removing an Administrator assignment is blocked with 403 when fewer than two active Administrators would remain; a caller lacking delete permission also receives 403.