# Decline Patches Declines one or more patches for the specified custom group(s) and customers, with each patch requiring a reasonId and remarks. The API does not support the Linux platform; therefore, Linux patches were automatically excluded. ## Endpoints `PUT /dcapi/patch/settings/declinePatch/declinePatches` ## Request URL `https://{server-hostname}:8383/dcapi/patch/settings/declinePatch/declinePatches` ## Scope `PatchMgmt.UPDATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** (`string`, Mandatory): `application/declinePatches.v1+json` - **Accept** (`string`, Mandatory): `application/declinePatches.v1+json` ### Request Body `application/json` - JSON Object - **patches** (`JSON Array`, Optional): List of patch objects to decline. Each object contains patch ID, reason ID and remarks. - **customGroupID** (`JSON Array`, Optional): List of custom group resource IDs to decline patches for. Cannot be empty. ## Sample Request ```curl curl --request PUT \ --url https://appdomain/dcapi/patch/settings/declinePatch/declinePatches \ --header 'Accept: application/declinePatches.v1+json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/declinePatches.v1+json' \ --data '{"patches":[{"reasonId":"1","id":"110001","remarks":"Vendor reported crash on reboot"}],"customGroupID":["301"]}' ``` ## Sample Request Body ### Decline a single patch for one custom group ```json { "patches": [ { "reasonId": "1", "id": "110001", "remarks": "Vendor reported crash on reboot" } ], "customGroupID": [ "301" ] } ``` ### Decline multiple patches with different reasons for multiple custom groups ```json { "patches": [ { "reasonId": "1", "id": "110001", "remarks": "Vendor-reported patch issue causing BSOD" }, { "reasonId": "3", "id": "110002", "remarks": "Conflicts with in-house CRM application v4.2" }, { "reasonId": "5", "id": "110003", "remarks": "Awaiting approval from change advisory board" } ], "customGroupID": [ "501", "502" ] } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` - JSON Object - **status** (`string`): Operation result: 'success' when patches are declined successfully - **message** (`string`): Localized success message ### HTTP Code 400 Response Body: `application/json` - JSON Object - **errorCode** (`string`): Validation error code: INSUFFICIENT_DATA=missing required fields, INVALID_DATA=invalid format or business rule violation (e.g., All Computers mixed with other groups, non-numeric id/reasonId) - **errorMessage** (`string`): Detailed message describing the specific validation failure ### HTTP Code 401 Response Body: `application/json` - JSON Object - **errorCode** (`long`): Unauthorized error code returned when authentication credentials are missing, expired, or invalid (authentication=required) - **errorMsg** (`string`): Authentication failure reason ### HTTP Code 403 Response Body: `application/json` - JSON Object - **errorCode** (`string`): Authorization error code: UAC_UNAUTHORIZED when user lacks access to selected custom groups - **errorMessage** (`string`): Message indicating the user is not authorized to decline patches for the selected groups ### HTTP Code 500 Response Body: `application/json` - JSON Object - **errorCode** (`string`): Internal error code: unexpected server error during decline operation - **errorMessage** (`string`): Error message describing the internal failure ## Possible Response Codes - `200` HTTP code - `400` HTTP code - `401` HTTP code - `403` HTTP code - `500` HTTP code ## Sample Response: HTTP 200 ### Patches declined successfully ```json { "message": "Patches declined successfully", "status": "success" } ``` ## Sample Response: HTTP 400 ### Patches list is empty or null ```json { "errorMessage": "Patches list is empty", "errorCode": "INSUFFICIENT_DATA" } ``` ### A patch object is missing the required reasonId ```json { "errorMessage": "reasonId is mandatory for patch id: 110001", "errorCode": "INSUFFICIENT_DATA" } ``` ### All Computers group selected with other custom groups ```json { "errorMessage": "All Computer Groups cannot be selected with other Custom Groups", "errorCode": "INVALID_DATA" } ``` ## Sample Response: HTTP 401 ### Authentication credentials missing or invalid ```json { "errorMessage": "Authentication credentials are missing or invalid", "errorCode": "UNAUTHORIZED" } ``` ## Sample Response: HTTP 403 ### User lacks access to the selected custom groups ```json { "errorMessage": "The user is not authorized to perform this operation!", "errorCode": "UAC_UNAUTHORIZED" } ``` ## Sample Response: HTTP 500 ### Unexpected server error during decline ```json { "errorMessage": "An internal error occurred while processing the request", "errorCode": "INTERNAL_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.