# Creates a new application group with specified rules Creates a new application group (whitelist or blacklist) with the specified application rules. Use the [Get App Rules by Type](https://www.manageengine.com/products/desktop-central/help/api/onpremise/acp-get-app-rule-types.html) API to retrieve vendorID, productVendorID, or storeAppID values to use as verifiedAppRepoIDs or unVerifiedAppRepoIDs in the request body. ## Endpoint **POST** `/dcapi/appctrl/appgroups` ## Request ### Request URL `https://{server-hostname}:8383/dcapi/appctrl/appgroups` ### Scope `AppControl.CREATE` ### Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **content-type** (`string`, Optional) #### Request Body `application/json` - **appGroupType** (`integer`, Mandatory): Application group type (0=Custom, 1=Whitelist, 2=Blacklist) - **platformID** (`integer`, Mandatory): Platform ID (1=Windows, 2=Mac) - **description** (`string`, Optional): Description of the application group (can be empty) - **appGroupName** (`string`, Mandatory): Name of the application group - **addedRules** (`JSON array`, Mandatory): Array of rules to add to the group — prefetch IDs from [Get App Rule Types](https://www.manageengine.com/products/desktop-central/help/api/onpremise/acp-get-app-rule-types.html) - **removedRules** (`array`, Mandatory): Array of rules to remove (empty array for new group creation) ## Sample Request ```curl curl --request POST \ --url https://appdomain/dcapi/appctrl/appgroups \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: SOME_STRING_VALUE' \ --data '{"removedRules":[],"appGroupName":"Test 1","appGroupType":0,"description":"","platformID":1,"addedRules":[{"appRuleType":1,"verifiedAppRepoIDs":["302","314","311","313"]},{"appRuleType":9,"unVerifiedAppRepoIDs":["5","6","10"]}]}' ``` ## Sample Request Body ### Create an application group with vendor rules (verified) and store app rules (unverified) ```json { "removedRules": [], "appGroupName": "Test 1", "appGroupType": 0, "description": "", "platformID": 1, "addedRules": [ { "appRuleType": 1, "verifiedAppRepoIDs": [ "302", "314", "311", "313" ] }, { "appRuleType": 9, "unVerifiedAppRepoIDs": [ "5", "6", "10" ] } ] } ``` ### Create a whitelist group with product rules ```json { "removedRules": [], "appGroupName": "Approved Applications", "appGroupType": 1, "description": "Whitelist for approved software", "platformID": 1, "addedRules": [ { "appRuleType": 2, "verifiedAppRepoIDs": [ "15", "13", "12" ] } ] } ``` ### Create a blacklist group with executable hash rules ```json { "removedRules": [], "appGroupName": "Blocked Applications", "appGroupType": 2, "description": "Blocked malicious executables", "platformID": 1, "addedRules": [ { "appRuleType": 4, "verifiedAppRepoIDs": [ "101", "102" ] } ] } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` - **appGrpId** (`string`): Unique identifier of the newly created application group ### HTTP Code 400 Response Body: `application/json` - **errorCode** (`string`): Error code: INVALID_REQUEST for validation failures - **errorMessage** (`string`): Detailed validation error message ### HTTP Code 401 Response Body: `application/json` - **errorCode** (`long`): Unauthorized error code returned when authentication credentials are missing, expired, or invalid (authentication=required) - **errorMsg** (`string`): Authentication failure reason ### HTTP Code 500 Response Body: `application/json` - **errorCode** (`string`): Internal error code: INTERNAL_ERROR when exception occurs creating app group - **errorMessage** (`string`): Detailed message: Exception Occurred While creating AppGroup ## Possible Response Codes - **200**: HTTP code - **400**: HTTP code - **401**: HTTP code - **500**: HTTP code ## Sample Responses ### HTTP 200 Application group created successfully ```json { "appGrpId": "2" } ``` ### HTTP 400 Invalid request parameters ```json { "errorMessage": "Invalid application group type or platform ID", "errorCode": "INVALID_REQUEST" } ``` ### HTTP 401 Authentication credentials missing or invalid ```json { "errorMessage": "Authentication credentials are missing or invalid", "errorCode": "UNAUTHORIZED" } ``` ### HTTP 500 Internal error while creating application group ```json { "errorMessage": "Exception Occurred While creating AppGroup", "errorCode": "INTERNAL_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.