> ## 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. # Delete Role > Permission required: `access-permissions` - Roles that have the protected value as true can't be deleted (such as: `admin`, `moderator`, `user` and so on). - You cannot delete roles that are assigned to users. To do that, you must first remove this role from all the users. ### Changelog | Version | Description | | ---------------- | ------------| |3.17.0 | Added | ## OpenAPI ````json POST /api/v1/roles.delete { "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.delete": { "parameters": [], "post": { "summary": "Delete Role", "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.delete", "parameters": [ { "$ref": "#/components/parameters/UserId" }, { "$ref": "#/components/parameters/Auth-Token" } ], "description": "Permission required: `access-permissions`\n- Roles that have the protected value as true can't be deleted (such as: `admin`, `moderator`, `user` and so on).\n- You cannot delete roles that are assigned to users. To do that, you must first remove this role from all the users.\n\n### Changelog\n| Version | Description |\n| ---------------- | ------------|\n|3.17.0 | Added |", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "roleId": { "type": "string", "example": "6579adcf2dd9f9d9514f6", "description": "The ID of an existing role." } }, "required": [ "roleId" ] } } } } } } }, "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" } } } } ````