# Creates a copy of an existing dynamic custom group Clones an existing dynamic custom group by copying its criteria pattern to a new group with the specified name and description. Only computer-type dynamic groups can be cloned via this endpoint — static, static-unique, and user-type dynamic groups are not supported (dynamic custom groups only support computer-type; user-type dynamic groups do not exist). The source group must exist and be accessible to the caller. The new group name must not already exist. Members of the cloned group are populated by re-evaluating the copied criteria, not by copying members from the source. Prerequisites: Call [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/help/api/onpremise/custom-groups-get-cglist.html) to look up the sourceCGId of the dynamic group you want to clone (filter for `group_category='Dynamic'` in the returned `cg_list`). ## Endpoint `POST /api/1.4/customgroup/dynamic/clone` ## Request ### Request URL `https://{server-hostname}:8383/api/1.4/customgroup/dynamic/clone` ### Scope `Common.UPDATE` ### Header `Authorization: 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` - JSON Object - **groupName** (`string`, Mandatory) - Name for the cloned group. Max 100 chars. Must be unique. - **description** (`string`, Optional) - Description. Max 250 chars. - **sourceCGId** (`long`, Mandatory) - Resource ID of the source dynamic group. Must exist, be dynamic, and be accessible. Fetch from [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/help/api/onpremise/custom-groups-get-cglist.html). ### Sample Request ```curl curl --request POST \ --url https://appdomain/api/1.4/customgroup/dynamic/clone \ --header 'Accept: application/json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"groupName":"Windows 11 PCs - Copy","sourceCGId":302,"description":"Cloned from Windows 11 PCs for testing"}' ``` ### Sample Request Body Clone a dynamic group, copying all its criteria to a new group. ```json { "groupName": "Windows 11 PCs - Copy", "sourceCGId": 302, "description": "Cloned from Windows 11 PCs for testing" } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - JSON Object - **message_type** (`string`) - Always 'dynamic' for this endpoint. - **message_response** (`JSON Object`) - Response payload container. - **message_version** (`string`) - API version: '1.4'. - **status** (`string`) - 'success' when the request completed without errors. ### HTTP Code 404 Response Body — `application/json` - JSON Object - **message_type** (`string`) - Always 'dynamic' for this endpoint. - **message_version** (`string`) - API version: '1.4'. - **status** (`string`) - Always 'error' for error responses. - **error_code** (`string`) - '70506' (CG_INVALID_DETAILS_TO_UPDATE). - **error_description** (`string`) - Resolved I18N message: 'No such Custom Group found.'. ### HTTP Code 412 Response Body — `application/json` - JSON Object - **message_type** (`string`) - Always 'dynamic' for this endpoint. - **message_version** (`string`) - API version: '1.4'. - **status** (`string`) - Always 'error' for error responses. - **error_code** (`string`) - '70502' (CG_DUPLICATE_NAME). - **error_description** (`string`) - Resolved I18N message: 'Custom group name is already in use.'. ### HTTP Code 500 Response Body — `application/json` - JSON Object - **message_type** (`string`) - Always 'dynamic' for this endpoint. - **message_version** (`string`) - API version: '1.4'. - **status** (`string`) - Always 'error' for error responses. - **error_code** (`string`) - Internal error code: '1003' (INTERNAL_ERROR). - **error_description** (`string`) - Resolved I18N message, typically: An internal error occurred while processing the request. ### Possible Response Codes - `200` — HTTP code - `404` — HTTP code - `412` — HTTP code - `500` — HTTP code ### Sample Response: HTTP 200 New group created with same criteria as source. ```json { "message_type": "dynamic", "message_response": { "dynamic": { "groupName": "Windows 11 PCs - Copy", "groupType": "Computer", "groupCategory": 2, "cgResourceId": "305" } }, "message_version": "1.4", "status": "success" } ``` ### Sample Response: HTTP 404 sourceCGId does not exist, is not dynamic, or user lacks access. ```json { "error_description": "No such Custom Group found.", "message_type": "dynamic", "error_code": "70506", "message_version": "1.4", "status": "error" } ``` ### Sample Response: HTTP 412 A group with this name already exists. ```json { "error_description": "Custom group name is already in use.", "message_type": "dynamic", "error_code": "70502", "message_version": "1.4", "status": "error" } ``` ### Sample Response: HTTP 500 Unexpected server-side failure during clone. ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "dynamic", "error_code": "1003", "message_version": "1.4", "status": "error" } ``` ## Rate Limit ![](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.