# Updates a static custom group's name, description, or member resources Updates a static custom group (groupCategory=1). Requires groupId and resourceIds. Important: Do not include groupType or groupCategory in the request body — these are immutable after creation and will be rejected. The resourceIds field is required and replaces the entire member list — pass the full desired member set on every update; partial omission is not supported. Prerequisites: Call [Get Available Resources](https://www.manageengine.com/products/desktop-central/custom-groups-get-available-resources.html) to discover valid resource IDs for the replacement member list. ## Endpoints **POST** `/api/1.4/customgroup/updateCg` ## Request URL ``` https://{serverurl}/api/1.4/customgroup/updateCg ``` * `{serverurl}` — See [OAuth Authentication - Endpoint Domain](https://www.manageengine.com/products/desktop-central/oauth-authentication-endpoint-domain.html) ## Scope ``` DesktopCentralCloud.Common.UPDATE ``` ## Header ``` Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52 ``` ## Request Parameters ### Request Headers - **Content-Type** (string) — **Mandatory** `application/json` Must be application/json. Request body must be valid JSON. - **Accept** (string) — **Mandatory** `application/json` Must be application/json. Only JSON responses are supported. ### Request Body **application/json** - **groupId** (long) — **Mandatory** Resource ID of the group to update. Fetch from [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/custom-groups-get-cglist.html). - **groupName** (string) — Optional Updated group name. Max 100 chars. Must be unique. - **description** (string) — Optional Updated description. Max 250 chars. - **resourceIds** (array) — **Mandatory** Complete replacement member list. Pass the entire desired member set on every update — partial omission is not supported. Fetch IDs from [Get Available Resources](https://www.manageengine.com/products/desktop-central/custom-groups-get-available-resources.html). ## Sample Request ### Curl ```bash curl --request POST \ --url https://appdomain/api/1.4/customgroup/updateCg \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"groupId":301,"resourceIds":[101,102,103,104,105]}' ``` ### Java ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; import java.net.http.HttpTimeoutException; public class Main { public static void main(String[] args) throws IOException, InterruptedException { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://appdomain/api/1.4/customgroup/updateCg")) .header("Content-Type", "application/json") .header("Accept", "application/json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("POST", HttpRequest.BodyPublishers.ofString("{\"groupId\":301,\"resourceIds\":[101,102,103,104,105]}")) .build(); HttpResponse response = HttpClient.newHttpClient() .send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("appdomain") payload = "{\"groupId\":301,\"resourceIds\":[101,102,103,104,105]}" headers = { 'Content-Type': "application/json", 'Accept': "application/json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("POST", "/api/1.4/customgroup/updateCg", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ### Deluge ```javascript headersMap = Map(); headersMap.put("Content-Type", "application/json"); headersMap.put("Accept", "application/json"); data = Map(); data.put("groupId","1"); data_resourceIds = List(); data.put("resourceIds", data_resourceIds); response = invokeUrl [ url: "https://appDomain/api/1.4/customgroup/updateCg" type: POST headers: headersMap body: data connection: connection_name ]; info response; ``` ### PowerShell ```powershell $headers=@{} $headers.Add("Content-Type", "application/json") $headers.Add("Accept", "application/json") $headers.Add("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") $response = Invoke-WebRequest ` -Uri 'https://appdomain/api/1.4/customgroup/updateCg' ` -Method POST ` -Headers $headers ` -ContentType 'application/json' ` -Body '{"groupId":301,"resourceIds":[101,102,103,104,105]}' ``` ## Sample Request Body Replace the entire member list and update description. ```json { "groupName": "Windows Servers", "groupId": 301, "description": "Updated - Production and Staging Windows Servers", "resourceIds": [ 101, 102, 103, 104, 105 ] } ``` ## Response Parameters ### HTTP 200 **Response Body — application/json** - **message_type** (string) Always `updateCg` for this endpoint. - **message_response** (object) Response payload container. - **updatecg** (object) Response payload. - **cgResourceId** (string) Resource ID of the updated group (returned as string). Use as cgId in [Delete CG](https://www.manageengine.com/products/desktop-central/custom-groups-delete-cg.html), or as groupId in a subsequent [Update Static CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-cg.html) / [Update Static Unique CG](https://www.manageengine.com/products/desktop-central/custom-groups-update-static-unique-cg.html) call. - **groupName** (string) Current name after update. - **invalidResourceIds** (array) [Conditional] Array of resource IDs that were not found or not valid. Present only when some submitted resourceIds are invalid. - **message_version** (string) API version: `1.4`. - **status** (string) `success` when the request completed without errors. #### Sample Response — Group details and membership updated ```json { "message_type": "updateCg", "message_response": { "updatecg": { "groupName": "Windows Servers", "cgResourceId": "301" } }, "message_version": "1.4", "status": "success" } ``` #### Sample Response — Static group updated but some submitted resource IDs were not found ```json { "message_type": "updateCg", "message_response": { "updatecg": { "groupName": "Windows Servers", "invalidResourceIds": [ 999, 998 ], "cgResourceId": "301" } }, "message_version": "1.4", "status": "success" } ``` ### HTTP 404 **Response Body — application/json** - **message_type** (string) — Always `updateCg` - **message_version** (string) — `1.4` - **status** (string) — `error` - **error_code** (string) — `70506` (CG_INVALID_DETAILS_TO_UPDATE) - **error_description** (string) — `No such Custom Group found.` — group does not exist, user is out of scope, or group is invalid for current product edition. #### Sample Response ```json { "error_description": "No such Custom Group found.", "message_type": "updateCg", "error_code": "70506", "message_version": "1.4", "status": "error" } ``` ### HTTP 412 **Response Body — application/json** - **message_type** (string) — Always `updateCg` - **message_version** (string) — `1.4` - **status** (string) — `error` - **error_code** (string) `70501` (CG_CREATE_UPDATE_PARAMS_MISSING) `70502` (CG_DUPLICATE_NAME) `70509` (CG_DUMMY_CG_RENAME) `70503` (CG_NULL_CRITERIA_PATTERN) `70517` (CG_INVALID_CRITERIA_PATTERN) `70508` (CG_MORE_COMPUTERS_DUMMY_CG) `70513` (CG_INVALID_CREATION_MODE) - **error_description** (string) `Required parameters are missing to create/update Custom Group.` (70501) `Custom group name is already in use.` (70502) `All Features Group cannot be renamed.` (70509) `Criteria pattern is empty.` (70503) `Invalid criteria pattern.` (70517) `Computer limit exceeded for free edition.` (70508) `Only manually created Custom Group is allowed to be accessed using external apis.` (70513) #### Sample Response ```json { "error_description": "Required parameters are missing to create/update Custom Group.", "message_type": "updateCg", "error_code": "70501", "message_version": "1.4", "status": "error" } ``` ### HTTP 500 **Response Body — application/json** - **message_type** (string) — Always `updateCg` - **message_version** (string) — `1.4` - **status** (string) — `error` - **error_code** (string) — `1003` (INTERNAL_ERROR) - **error_description** (string) — An internal error occurred while processing the request. #### Sample Response ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "updateCg", "error_code": "1003", "message_version": "1.4", "status": "error" } ``` ## Possible Response Codes - **200** - **404** - **412** - **500** --- **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.