> ## 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. # Remove Role from User > Remove a role from a user. Permission required: `access-permissions` ## OpenAPI ````json POST /api/v1/roles.removeUserFromRole { "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.removeUserFromRole": { "post": { "summary": "Remove Role from User", "tags": [ "Roles" ], "responses": { "200": { "$ref": "#/components/responses/trueSuccess" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" } } }, "examples": { "Example 1": { "value": { "success": false, "error": "The role properties are invalid. [error-invalid-role-properties]", "errorType": "error-invalid-role-properties" } }, "Example 2": { "value": { "success": false, "error": "Accessing permissions is not allowed [error-action-not-allowed]", "errorType": "error-action-not-allowed" } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } }, "operationId": "post-api-v1-roles.removeUserFromRole", "parameters": [ { "$ref": "#/components/parameters/UserId" }, { "$ref": "#/components/parameters/Auth-Token" } ], "description": "Remove a role from a user. Permission required: `access-permissions`", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "roleId": { "type": "string", "example": "6579adcf2dd9f9d9514f6", "description": "The ID of an existing role." }, "username": { "type": "string", "description": "The username for which you want to remove the role.", "example": "user08" }, "scope": { "type": "string", "description": "Optionally, you can also provide the role scope. The options are `Users` and `Subscriptions`." } }, "required": [ "roleId", "username" ] } } } } } } }, "components": { "responses": { "trueSuccess": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } }, "examples": { "Success": { "value": { "success": true } } } } } }, "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" } } } } ````