Skip to content

Update Roles

Updates the specified roles.

Note

A role cannot be moved to a different organization on update; its organizationId is fixed. The organizationId field is still required in the request body, but any value other than the role's current organization is ignored rather than rejected.

Verb PATCH
Endpoint {base-url}/roles/
Max Page Size N/A

Request Body

{
  "body": [
    {
      "roleId": 2,
      "name": "update test",
      "description": "update test description"
    }
  ]
}

Note

All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.

Returns

On Success

Echoes back the provided data.

Response Body

[
  {
    "organizationId": 2,
    "id": 2,
    "name": "update test",
    "description": "update test description"
  }
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more of the specified role id values belongs to an organization you do not have access to.
404 MISSING_RECORD One or more of the specified role id values does not exist.
422 VALIDATION_ERROR A required field (organizationId, name) is missing or invalid.
422 VALIDATION_ERROR name exceeds 50 characters, or description exceeds 200 characters.