# Update an existing role's name, description, and permissions Updates an existing role identified by roleId. Supports renaming the role, updating its description, and modifying product-level module and feature permissions. [0=Full-control; 1=Read-Write; 2=Read-Only; -1=No Access] ## Endpoints **PUT** `/emsapi/roles` ## Request ### Request URL https://[*{serverurl}*](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/emsapi/roles ### Scope `DesktopCentralCloud.Admin.UPDATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **accept** (`string`, Mandatory): `application/updateRole.v1+json` - Specifies the expected response format. Set to application/updateRole.v1+json to receive the role update response in JSON format. - **content-type** (`string`, Mandatory): `application/updateRole.v1+json` - Specifies the request payload format. Set to application/updateRole.v1+json to submit the role data in JSON format. #### Request Body `application/json` - **roleId** (`string`, Mandatory) - Unique identifier of the role to be updated. Required for identifying which role to modify. - **roleName** (`string`, Optional) - Updated name for the role. Supports alphanumeric characters, spaces, and special characters. Maximum 100 characters. - **roleDescription** (`string`, Optional) - Updated description of the role's purpose and access level. Maximum 250 characters. - **roleDetails** (`JSON Object`, Optional) - Product-keyed object mapping each product name to its module and feature permission details to be updated for this role. ### Sample Request ```curl curl --request PUT \ --url https://appdomains/emsapi/roles \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'accept: application/updateRole.v1+json' \ --header 'content-type: application/updateRole.v1+json' \ --data '{"roleId":"97913000000566047"}' ``` ### Sample Request Body Update role with full module structure across desktopCentral, osd, browserSecurity, SecurityAddOn, and mdm. ```json { "roleId": "97913000000566047", "roleName": "Security Auditor", "roleDetails": { "osd": { "modules": [ { "0": true, "1": true, "2": true, "-1": false, "value": "OSD Imaging" }, { "0": true, "1": true, "2": true, "-1": false, "value": "OSD Deployment" } ] }, "desktopCentral": { "modules": [ { "0": false, "1": false, "2": false, "-1": true, "moduleId": "97913000000010497", "value": "Configurations" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Patch Management" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Vulnerability Mgmt" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Software Deployment" }, { "0": false, "1": false, "2": false, "-1": true, "moduleId": "97913000000010506", "value": "Inventory" }, { "0": false, "1": false, "2": false, "-1": true, "moduleId": "97913000000010509", "value": "Tools" }, { "0": false, "1": false, "2": false, "-1": true, "value": "RDS" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Endpoint Intelligence" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Sensors" }, { "0": false, "1": false, "2": false, "-1": true, "value": "UEMSWorkflow" }, { "0": false, "1": false, "2": false, "-1": true, "value": "Reports" }, { "-1": true, "value": "Query Reports" }, { "0": true, "1": true, "2": true, "-1": false, "value": "SOM" } ] }, "mdm": { "modules": [ { "0": false, "1": false, "2": false, "-1": true, "value": "MDM Enrollment" } ] }, "SecurityAddOn": { "modules": [ { "0": true, "1": true, "2": true, "-1": false, "value": "Application Control" } ] }, "browserSecurity": { "modules": [ { "0": false, "1": false, "2": false, "-1": true, "value": "BSP Inventory" } ] } }, "roleDescription": "Security Auditor" } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - **roleId** (`string`) - Unique identifier of the updated role. - **roleName** (`string`) - Name of the role after the update. - **message** (`string`) - Success message confirming role update. - **successCode** (`string`) - Success code for the role update operation. ### HTTP Code 412 Response Body — `application/json` - **errorCode** (`string`) - Application-specific error code indicating the reason for the request failure. - **errorMsg** (`string`) - Error message describing the cause of the error. ### Possible Response Codes - **200** — HTTP code - **412** — HTTP code ### Sample Response: HTTP 200 Role update success response. ```json { "roleId": "97913000000010554", "roleName": "Endpoint Technician", "message": "Role Endpoint Technician has been modified successfully.", "successCode": "40019" } ``` ### Sample Response: HTTP 412 The Role Name already exists. Please choose a different name. ```json { "errorCode": "40018", "errorMsg": "Role name Product Admin already exists." } ``` ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 30 | **Lock period:** 5 minutes Duration - Time window for the threshold. Threshold - Number of API calls allowed within the specified duration. Lock Period - Wait time before consecutive API requests.