# 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. ## Endpoint `PUT /dcapi/patch/settings/declinePatch/declinePatches` ## Request URL `https://[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)/dcapi/patch/settings/declinePatch/declinePatches` ### Scope `DesktopCentralCloud.PatchMgmt.UPDATE` ### Header `Authorization: Zoho-oauthtoken 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 curl --request PUT \ --url https://appdomains/dcapi/patch/settings/declinePatch/declinePatches \ --header 'Accept: application/declinePatches.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/declinePatches.v1+json' \ --data '{}' ``` ### Java ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.io.IOException; import java.net.http.HttpTimeoutException; public class Main { public static void main(String[] args) { HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://appdomains/dcapi/patch/settings/declinePatch/declinePatches")) .header("Content-Type", "application/declinePatches.v1+json") .header("Accept", "application/declinePatches.v1+json") .header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") .method("PUT", HttpRequest.BodyPublishers.ofString("{}")) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("appdomains") payload = "{}" headers = { 'Content-Type': "application/declinePatches.v1+json", 'Accept': "application/declinePatches.v1+json", 'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52" } conn.request("PUT", "/dcapi/patch/settings/declinePatch/declinePatches", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ### Deluge ```javascript headersMap = Map(); headersMap.put("Content-Type", "application/declinePatches.v1+json"); headersMap.put("Accept", "application/declinePatches.v1+json"); data=Map(); response = invokeUrl [ url: "https://appDomains/dcapi/patch/settings/declinePatch/declinePatches" type: PUT headers: headersMap body: data connection: connection_name ] info response; ``` ### PowerShell ```powershell $headers=@{} $headers.Add("Content-Type", "application/declinePatches.v1+json") $headers.Add("Accept", "application/declinePatches.v1+json") $headers.Add("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52") $response = Invoke-WebRequest -Uri 'https://appdomains/dcapi/patch/settings/declinePatch/declinePatches' -Method PUT -Headers $headers -ContentType 'application/declinePatches.v1+json' -Body '{}' ``` ## 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 (for example, 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: credentials missing, expired, or invalid - **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 Responses ### HTTP 200: Patches Declined Successfully ```json { "message": "Patches declined successfully", "status": "success" } ``` ### HTTP 400: Patches List Is Empty or Null ```json { "errorMessage": "Patches list is empty", "errorCode": "INSUFFICIENT_DATA" } ``` ### HTTP 400: A Patch Object Is Missing the Required reasonId ```json { "errorMessage": "reasonId is mandatory for patch id: 110001", "errorCode": "INSUFFICIENT_DATA" } ``` ### HTTP 400: All Computers Group Selected With Other Custom Groups ```json { "errorMessage": "All Computer Groups cannot be selected with other Custom Groups", "errorCode": "INVALID_DATA" } ``` ### HTTP 401: Authentication Credentials Missing or Invalid ```json { "errorMessage": "Authentication credentials are missing or invalid", "errorCode": "UNAUTHORIZED" } ``` ### HTTP 403: User Lacks Access to the Selected Custom Groups ```json { "errorMessage": "The user is not authorized to perform this operation!", "errorCode": "UAC_UNAUTHORIZED" } ``` ### 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.