# Updates a dynamic custom group's name, description, or criteria list Updates a dynamic custom group (`groupCategory=2`). Requires `groupId`. Only computer-type dynamic groups exist; user-type dynamic groups are not supported. The `criteriaList` field replaces all existing criteria entirely, and members are re-evaluated after update. If `criteriaPattern` is omitted, the existing join pattern stored on the group is preserved. **Important:** Do not include `groupType` or `groupCategory` in the request body. These are immutable after creation and will be rejected. Prerequisites: Call [Get Dynamic CG Criteria Pattern](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-dynamic-cgcriteria-pattern.html) to discover available columns and operators, and [Get Dynamic CG Column Values](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-dynamic-cgcolumn-values.html) to fetch valid comparison values. ## Endpoint `POST /api/1.4/customgroup/updateCg` ## Request ### Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/api/1.4/customgroup/updateCg` ### Scope `DesktopCentralCloud.Common.UPDATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Headers #### Content-Type **Type:** `string` **Required:** Yes **Value:** `application/json` Must be `application/json`. Request body must be valid JSON. #### Accept **Type:** `string` **Required:** Yes **Value:** `application/json` Must be `application/json`. Only JSON responses are supported. ### Request Body `application/json` #### groupId **Type:** `long` **Required:** Yes Resource ID of the group to update. Fetch from [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-cglist.html). #### groupName **Type:** `string` **Required:** No Updated group name. Maximum 100 characters. #### description **Type:** `string` **Required:** No Updated description. Maximum 250 characters. #### criteriaList **Type:** `JSON Array` **Required:** Yes Replaces existing criteria entirely. Members will be re-evaluated. Fetch available columns and operators from [Get Dynamic CG Criteria Pattern](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-dynamic-cgcriteria-pattern.html). #### criteriaPattern **Type:** `string` **Required:** No Updated criteria join pattern using 1-based indices, such as `1 AND 2`. If omitted, the existing pattern stored on the group is reused. ### Sample Request ```curl curl --request POST \ --url https://appdomains/api/1.4/customgroup/updateCg \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"groupId":302,"criteriaList":[{"comparator":"contains","logicalOperator":"AND","columnId":1,"criteriaValue":["Windows 11"]},{"comparator":"equal","logicalOperator":"AND","columnId":3,"criteriaValue":["64-bit"]}]}' ``` ### Sample Request Body Change criteria from a single OS filter to OS and architecture combined. ```json { "groupName": "Windows 11 PCs", "groupId": 302, "description": "Updated - Windows 11 64-bit workstations only", "criteriaList": [ { "comparator": "contains", "logicalOperator": "AND", "columnId": 1, "criteriaValue": [ "Windows 11" ] }, { "comparator": "equal", "logicalOperator": "AND", "columnId": 3, "criteriaValue": [ "64-bit" ] } ], "criteriaPattern": "1 AND 2" } ``` ## Response Parameters ### HTTP 200 Response body: `application/json` #### message_type **Type:** `string` Always `updateCg` for this endpoint. #### message_response **Type:** `JSON Object` Response payload container. #### message_version **Type:** `string` API version: `1.4`. #### status **Type:** `string` `success` when the request completed without errors. ### HTTP 404 Response body: `application/json` #### message_type **Type:** `string` Always `updateCg` for this endpoint. #### message_version **Type:** `string` API version: `1.4`. #### status **Type:** `string` Always `error` for error responses. #### error_code **Type:** `string` `70506` (`CG_INVALID_DETAILS_TO_UPDATE`). #### error_description **Type:** `string` Resolved I18N message: `No such Custom Group found.` The group does not exist, the user is out of scope, or the group is invalid for the current product edition. ### HTTP 412 Response body: `application/json` #### message_type **Type:** `string` Always `updateCg` for this endpoint. #### message_version **Type:** `string` API version: `1.4`. #### status **Type:** `string` Always `error` for error responses. #### error_code **Type:** `string` One of the following: - `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 **Type:** `string` Resolved I18N message varies by error code: - `70501`: `Required parameters are missing to create/update Custom Group.` - `70502`: `Custom group name is already in use.` - `70509`: `All Features Group cannot be renamed.` - `70503`: `Criteria pattern is empty.` - `70517`: `Invalid criteria pattern.` - `70508`: `Computer limit exceeded for free edition.` - `70513`: `Only manually created Custom Group is allowed to be accessed using external apis.` ### HTTP 500 Response body: `application/json` #### message_type **Type:** `string` Always `updateCg` for this endpoint. #### message_version **Type:** `string` API version: `1.4`. #### status **Type:** `string` Always `error` for error responses. #### error_code **Type:** `string` Internal error code: `1003` (`INTERNAL_ERROR`). #### error_description **Type:** `string` Resolved I18N message, typically: An internal error occurred while processing the request. ### Sample Response: HTTP 200 Criteria updated and member re-evaluation triggered. ```json { "message_type": "updateCg", "message_response": { "updatecg": { "groupName": "Windows 11 PCs", "cgResourceId": "302" } }, "message_version": "1.4", "status": "success" } ``` ### Sample Response: HTTP 404 Group ID does not exist or user lacks access. ```json { "error_description": "No such Custom Group found.", "message_type": "updateCg", "error_code": "70506", "message_version": "1.4", "status": "error" } ``` ### Sample Response: HTTP 412 `groupId` or `criteriaList` is missing. ```json { "error_description": "Required parameters are missing to create/update Custom Group.", "message_type": "updateCg", "error_code": "70501", "message_version": "1.4", "status": "error" } ``` ### Sample Response: HTTP 500 Unexpected server-side failure during update. ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "updateCg", "error_code": "1003", "message_version": "1.4", "status": "error" } ``` ## 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.