# 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 URL `https://{server-hostname}:8383/emsapi/roles` ## Scope `Admin.UPDATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers #### `accept` **Type:** string **Required:** Mandatory **Value:** `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` **Type:** string **Required:** Mandatory **Value:** `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 **Content type:** `application/json` #### JSON object ##### `roleId` **Type:** string **Required:** Mandatory Unique identifier of the role to be updated. Required for identifying which role to modify. ##### `roleName` **Type:** string **Required:** Optional Updated name for the role. Supports alphanumeric characters, spaces, and special characters. Maximum 100 characters. ##### `roleDescription` **Type:** string **Required:** Optional Updated description of the role's purpose and access level. Maximum 250 characters. ##### `roleDetails` **Type:** JSON object **Required:** 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://appdomain/emsapi/roles \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'accept: application/updateRole.v1+json' \ --header 'content-type: application/updateRole.v1+json' \ --data '{"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"}' ``` ## 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` #### JSON object ##### `roleId` **Type:** string Unique identifier of the updated role. ##### `roleName` **Type:** string Name of the role after the update. ##### `message` **Type:** string Success message confirming role update. ##### `successCode` **Type:** string Success code for the role update operation. ### HTTP Code 412 **Response body:** `application/json` #### JSON object ##### `errorCode` **Type:** string Application-specific error code indicating the reason for the request failure. ##### `errorMsg` **Type:** 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." } ``` ## Rate Limit **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.