# Create up to 500 software metering rules in a single request Allows you to add multiple software metering rules at once (up to 500). Each rule is processed individually — successfully created rules are saved, while any that fail validation are reported back with the reason for failure. ## Endpoints **POST** `/dcapi/inventory/software/metering/bulk` ## Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/dcapi/inventory/software/metering/bulk` ## Scope `DesktopCentralCloud.Inventory.WRITE` ## Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Accept** (string, Mandatory): `application/bulkRuleAddStatus.v1+json` - **Content-Type** (string, Mandatory): `application/bulkAddMeteringRules.v1+json` ### Request Body `application/json` - JSON Object - **rules** (JSON Array, Mandatory) ## Sample Request ```curl curl --request POST \ --url https://appdomains/dcapi/inventory/software/metering/bulk \ --header 'Accept: application/bulkRuleAddStatus.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/bulkAddMeteringRules.v1+json' \ --data '{"rules":[{"fileName":"string","softwareID":0,"ruleName":"string","osPlatform":0}]}' ``` ## Sample Request Body ```json { "rules": [ { "softwareID": 0, "osPlatform": 0, "ruleName": "string", "fileName": "string", "originalFileName": "string", "fileVersion": "string", "productName": "string", "comments": "string" } ] } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` - JSON Object - **status** (string): Overall outcome - SUCCESS (all entries inserted), PARTIAL_SUCCESS (mix of inserted and failed) or FAILURE (zero inserted) - **summary** (JSON Object): Counts: totalRequested, successCount, failedCount - **succeeded** (array): Entries inserted successfully. Each item carries softwareID, osPlatform, ruleName and the generated appDefinitionID - **failed** (array): Entries rejected by validation or DB write (including duplicate rule names). Each item carries errorCode, errorMessage and the original input object echoed back ### HTTP Code 400 Response Body: `application/json` - JSON Object - **error_code** (string): CUSTOMER_HEADER_MISSING - MSP environment requires X-Customer header - **error_description** (string): Missing customer header error message ### HTTP Code 401 Response Body: `application/json` - JSON Object - **error_code** (string): UAC_UNAUTHORIZED - user lacks the required uem-roles or credentials are missing - **error_description** (string): Authentication or authorization failure reason ### HTTP Code 500 Response Body: `application/json` - JSON Object - **error_code** (string): INTERNAL_ERROR - unexpected exception in the service layer - **error_description** (string): Internal server error message ## Possible Response Codes - **200** — HTTP code - **400** — HTTP code - **401** — HTTP code - **500** — HTTP code ## Sample Response: HTTP 200 Mixed bulk add outcome ```json { "summary": { "failedCount": 2, "successCount": 1, "totalRequested": 3 }, "failed": [ { "input": { "originalFileName": "Google Chrome.app", "fileName": "Google Chrome", "softwareID": 67890, "comments": "Track Chrome on Mac", "ruleName": "Chrome - Mac", "osPlatform": 2, "fileVersion": "", "productName": "Google Chrome" }, "errorMessage": "ruleName 'Chrome - Mac' is already in use", "errorCode": "DUPLICATE_RULE_NAME" }, { "input": { "originalFileName": "notepad++.exe", "fileName": "notepad++.exe", "softwareID": 789, "comments": "", "ruleName": "Notepad++ - Windows", "osPlatform": 1, "fileVersion": "", "productName": "Notepad++" }, "errorMessage": "Software 789 is not detected on osPlatform 1", "errorCode": "OS_PLATFORM_MISMATCH" } ], "status": "PARTIAL_SUCCESS", "succeeded": [ { "softwareID": 67890, "appDefinitionID": 9001, "ruleName": "Chrome - Windows", "osPlatform": 1 } ] } ``` ## Sample Response: HTTP 400 rules array missing, empty or above 500 ```json { "error_description": "rules array is required and must contain 1-500 entries", "error_code": "INVALID_DATA" } ``` ## Sample Response: HTTP 401 Caller lacks Inventory_Admin role ```json { "error_description": "Unauthorized access", "error_code": "UAC_UNAUTHORIZED" } ``` ## Sample Response: HTTP 500 Server error ```json { "error_description": "Internal server error", "error_code": "INTERNAL_ERROR" } ``` ![ ](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.