> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Update Role >
Premium tag
Update a role in the workspace.
Permission required: `access-permissions` ### Changelog | Version | Description | | ---------------- | ------------| |6.0.0 | Moved to Enterprise plan. | ## OpenAPI ````json POST /api/v1/roles.update { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "User Management" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "LDAP" }, { "name": "Permissions" }, { "name": "Roles" }, { "name": "Users" }, { "name": "SAML" } ], "paths": { "/api/v1/roles.update": { "post": { "tags": [ "Roles" ], "summary": "Update Role", "description": "
\"Premium
\n\nUpdate a role in the workspace.
\n\nPermission required: `access-permissions`\n \n### Changelog\n| Version | Description |\n| ---------------- | ------------|\n|6.0.0 | Moved to Enterprise plan. |", "operationId": "post-api-v1-roles.update", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "roleId": { "type": "string", "example": "646c431fa8c3a3ba32d0e1c4", "description": "The role ID that you want to update." }, "name": { "type": "string", "example": "newRole", "description": "The updated name of the role." }, "scope": { "type": "string", "example": "Subscriptions", "description": "The updated scope of the role. The scope can either be Users (user level) or Subscriptions (room level). The default value is `Users`." }, "description": { "type": "string", "example": "Role description", "description": "Updated description for the role." }, "mandatory2fa": { "type": "boolean", "default": "false", "description": "Whether the role should have a mandatory 2FA. The default value is `false`. If set to true, users assigned to this role are prompted to enter a 2FA code for certain activities." } }, "required": [ "roleId", "name" ] }, "examples": { "Example": { "value": { "roleId": "646c431fa8c3a3ba32d0e1c4", "name": "Test Role", "scope": "Users", "description": "Testing Role for API", "mandatory2fa": "false" } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "role": { "type": "object", "properties": { "_id": { "type": "string" }, "name": { "type": "string" }, "scope": { "type": "string" }, "description": { "type": "string" }, "protected": { "type": "boolean" }, "mandatory2fa": { "type": "boolean" }, "_updatedAt": { "type": "string" } } }, "success": { "type": "boolean" } } }, "examples": { "Success Example": { "value": { "role": { "_id": "646c431fa8c3a3ba32d0e1c4", "name": "update role", "scope": "Users", "description": "Update Role support tier 1", "protected": "false", "mandatory2fa": "false", "_updatedAt": "2023-05-23T05:33:33.73Z" }, "success": "true" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Missing Parameter": { "value": { "success": "false", "errorType": "invalid-params", "error": "must have required property 'name'" } }, "Access Permission not Allowed": { "value": { "success": "false", "error": "Accessing permissions is not allowed [error-action-not-allowed]", "errorType": "error-action-not-allowed" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } }, "parameters": [ { "$ref": "#/components/parameters/UserId" }, { "$ref": "#/components/parameters/Auth-Token" } ] } } }, "components": { "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } } }, "examples": { "Authorization Error": { "value": { "status": "error", "message": "You must be logged in to do this." } } } } } } }, "parameters": { "UserId": { "name": "X-User-Id", "in": "header", "description": "The authenticated user ID.", "required": "true", "schema": { "type": "string" }, "example": "rbAXPnMktTFbNpwtJ" }, "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The authenticated user token.", "required": "true", "schema": { "type": "string" }, "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" } } } } ````