# Deletes a custom group by ID Permanently deletes the specified custom group identified by cgId. This action is irreversible. Fetch the cgId from [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-cglist.html). Requires admin or customer-admin privileges, or ownership of the group. System-generated groups (e.g., All Computers, All Users) cannot be deleted. Returns a success message with the deleted group name. ## Endpoint `POST /api/1.4/customgroup/deleteCg` ## Request ### Request URL `https://`[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)`/api/1.4/customgroup/deleteCg` ### Scope `DesktopCentralCloud.Common.UPDATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **Accept** (`string`, mandatory): `application/json` - Must be application/json. Only JSON responses are supported. #### Query Parameters - **cgId** (`long`, mandatory) - Resource ID of the custom group to delete. Fetch from [Retrieve All Custom Groups](https://www.manageengine.com/products/desktop-central/help/api/cloud/custom-groups-get-cglist.html). ### Sample Request ```curl curl --request POST \ --url 'https://appdomains/api/1.4/customgroup/deleteCg?cgId=SOME_INTEGER_VALUE' \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' ``` ## Response Parameters ### HTTP Code 200 Response body: `application/json` - `JSON Object` - **message_type** (`string`): Always `'deleteCg'` 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. ### Sample Response: HTTP 200 Group and all its membership associations removed. ```json { "message_type": "deleteCg", "message_response": { "deletecg": { "message": "Windows Servers was successfully deleted!" } }, "message_version": "1.4", "status": "success" } ``` ### HTTP Code 404 Response body: `application/json` - `JSON Object` - **message_type** (`string`): Always `'deleteCg'` 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.'`. ### Sample Response: HTTP 404 Group ID does not exist or user lacks admin/owner privileges. ```json { "error_description": "No such Custom Group found.", "message_type": "deleteCg", "error_code": "70506", "message_version": "1.4", "status": "error" } ``` ### HTTP Code 500 Response body: `application/json` - `JSON Object` - **message_type** (`string`): Always `'deleteCg'` 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. ### Sample Response: HTTP 500 Unexpected server-side failure during deletion. ```json { "error_description": "An internal error occurred while processing the request.", "message_type": "deleteCg", "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.