Update a coworker's role and/or site assignments. Requires users.update permission.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
string | yes | The unique identifier of the record |
Request body
Required.
application/json
roleIdsstring (uuid)[] · requiredsiteIdsstring (uuid)[]
{
"roleIds": [
"01930a94-6a1a-7834-b6c2-4fb5efb0988a"
],
"siteIds": [
"019222d4-1d93-7d47-a3c4-b547e009a0f7"
]
}
Responses
| Status | Description |
|---|---|
| 200 | A json object describing the updated coworker |
| 403 | The requesting user lacks appropriate permissions |
| 404 | The coworker was not found |
| 422 | Validation errors |
Response 200 body
dataobject · required — When fields[] is not provided, all properties are returned. When fields[] is provided, only the requested properties are included.
{
"data": {
"id": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
"authProvider": "safesites",
"email": "john.doe@example.com",
"firstName": "John",
"lastName": "Doe",
"mfa": false,
"phoneNumber": "+46701234567",
"roles": [
{
"id": "01930a94-6a1a-7834-b6c2-4fb5efb0988a",
"name": "Admin"
}
],
"sites": [
{
"id": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
"name": "Stockholm Office"
}
]
}
}