# Adds a custom application rule to the rule repository Creates a new application rule based on vendor name, product name, executable file hash, or COM component. The newly created rule can then be added to any application group for allow or block enforcement. ## Endpoints **POST** `/dcapi/appctrl/customrule` ## Request URL `https://{server-hostname}:8383/dcapi/appctrl/customrule` ## Scope `AppControl.CREATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **content-type** `string` *(Optional)* ### Request Body `application/json` - **appRuleType** `string` *(Mandatory)*: Rule type (1=Vendor, 2=Product, 3=Executable, 4=FileHash, 20=Component) - **isVerified** `string` *(Mandatory)*: Verification status (1=verified, 0=unverified) - **platformID** `string` *(Mandatory)*: Platform ID (1=Windows, 2=Mac) - **vendorName** `string` *(Mandatory)*: Name of the software vendor - **productName** `string` *(Optional)*: Name of the software product. Required when appRuleType is 2 (Product). - **fileName** `string` *(Optional)*: Name of the executable file (e.g. myapp.exe). Required when appRuleType is 3 (Executable) or 4 (FileHash). - **sha256Hash** `string` *(Optional)*: SHA-256 hash of the file. Required when appRuleType is 4 (FileHash). - **hashType** `string` *(Optional)*: Refers to the type of hash (1=SHA-256, 2=CDHash) ## Sample Request ```curl curl --request POST \ --url https://appdomain/dcapi/appctrl/customrule \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: SOME_STRING_VALUE' \ --data '{"appRuleType":"1","isVerified":true,"platformID":"1","vendorName":"Adobe Systems"}' ``` ## Sample Request Body ### Create a vendor-based rule ```json { "appRuleType": "1", "isVerified": true, "platformID": "1", "vendorName": "Adobe Systems" } ``` ### Create a Product-based rule ```json { "appRuleType": 2, "isVerified": false, "platformID": 1, "vendorName": "Google", "productName": "glc" } ``` ### Create a Verified Executable rule ```json { "appRuleType": 3, "fileName": "dfsgsdfydhgfd", "platformID": 1, "vendorName": "fsdzfgdfsgrdgf", "productName": "fsdgfdghfhfd" } ``` ### Create a file hash rule for a Windows executable ```json { "appRuleType": "4", "fileName": "myapp.exe", "sha256Hash": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890", "isVerified": false, "platformID": "1", "hashType": 1 } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` - **appRuleType** `integer`: Rule type ID (1=Vendor, 2=Product, 3=Executable, 4=FileHash, 20=Component) - **appRuleID** `long`: Unique identifier for the created rule - **appRuleName** `string`: Display name of the created rule - **ruleDetails** `JSON object`: Detailed attributes of the created rule — structure varies by appRuleType ### 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 ## Possible Response Codes - **200** `HTTP code` - **401** `HTTP code` ## Sample Response: HTTP 200 ### Successfully created custom rule ```json { "appRuleType": 4, "appRuleID": 700, "ruleDetails": { "fileName": "myapp.exe", "sha256Hash": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890" }, "appRuleName": "myapp.exe" } ``` ## Sample Response: HTTP 401 ### Authentication credentials missing or invalid ```json { "errorMessage": "Authentication credentials are missing or invalid", "errorCode": "UNAUTHORIZED" } ``` ## 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.