Update a role
patch/api/v1/roles/{id}This endpoint updates the properties of an existing user role, such as its name, description, or reporting role.
Code snippet
curl -X 'PATCH' \
'https://{yourdomain}/api/v1/roles/{id}' \
-H 'accept: text/plain; x-api-version=1.0' \
-H 'x-api-key: {your API key}' \
-H 'Content-Type: application/json-patch+json; x-api-version=1.0' \
-d '{
"data": {
"name": "Business Intelligence Analyst",
"description": "Develops dashboards and reports to support strategic decision-making",
"reportingRole": {
"id": 628
}
}
}'
Path parameters
| idintegerRequired | Unique identifier of the role to update. Must be a valid role ID that exists in the organization. |
Request body
| namestring | A new name for the role. If provided, it will replace the existing name of the role. | ||
| descriptionstring | An updated description for the role's purpose or responsibilities. | ||
reportingRoleobject | Existing role to which this role reports, creating a hierarchy.
|
Example response
200 Success
{
"message": "Role updated successfully.",
"data": {
"id": 101
}
}