# Perform an on-demand quarantine action on resources Performs an on-demand quarantine action on specific resources such as removing from quarantine, excluding from quarantine, or extending the exclusion period. ## Endpoint `PUT /dcapi/compliance/quarantine/onDemand` ## Request URL `https://{server-hostname}:8383/dcapi/compliance/quarantine/onDemand` ## Scope `VulnerabilityMgmt.UPDATE` ## Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** — `string` — **Mandatory**: `application/onDemandQuarantineAction.v1+json` - **Accept** — `string` — **Mandatory**: `application/onDemandQuarantineAction.v1+json` ### Request Body `application/json` - **resourceIds** — `array` — Optional - List of resource IDs to perform the on-demand action on. - **onDemandAction** — `string` — Optional - Action type: `removeFromQuarantine`, `doNotQuarantine`, `removeFromExclusionList`, or `extendExclusionList`. - **days** — `string` — Optional - Number of days for exclusion period (required for `removeFromQuarantine`, `doNotQuarantine`, `extendExclusionList`). ## Sample Request ```curl curl --request PUT \ --url https://appdomain/dcapi/compliance/quarantine/onDemand \ --header 'Accept: application/onDemandQuarantineAction.v1+json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/onDemandQuarantineAction.v1+json' \ --data '{"onDemandAction":"removeFromQuarantine","days":"7","resourceIds":["1001","1002","1003"]}' ``` ## Sample Request Body ### Remove selected resources from quarantine isolation ```json { "onDemandAction": "removeFromQuarantine", "days": "7", "resourceIds": [ "1001", "1002", "1003" ] } ``` ### Extend grace period for pending quarantine resources ```json { "onDemandAction": "doNotQuarantine", "days": "14", "resourceIds": [ "1001" ] } ``` ### Remove resources from the exclusion list to re-quarantine them ```json { "onDemandAction": "removeFromExclusionList", "resourceIds": [ "1001", "1002" ] } ``` ### Extend the exclusion period for already-excluded resources ```json { "onDemandAction": "extendExclusionList", "days": "30", "resourceIds": [ "1001" ] } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - **status** — `string` - Operation result. `success` on successful action. - **message** — `string` - Human-readable message describing the action taken. ### HTTP Code 400 Response Body — `application/json` - **statusCode** — `string` - HTTP status code (`400`). - **errorCode** — `string` - API-specific error code identifying the validation failure. - **message** — `string` - Error message describing the validation failure. ### 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 403 Response Body — `application/json` - **errorCode** — `string` - Forbidden error code indicating user lacks `ALL_MANAGED_COMPUTER_ROLE` permission. - **errorMessage** — `string` - Message indicating user must have permissions to manage all computers. ### HTTP Code 429 Response Body — `application/json` - **errorCode** — `long` - Rate limit error code returned when the API call threshold (configured via threshold/duration in security XML) is exceeded; client is locked out for lock-period minutes. - **errorMsg** — `string` - Rate limit exceeded message with retry guidance. ## Possible Response Codes - `200` — HTTP code - `400` — HTTP code - `401` — HTTP code - `403` — HTTP code - `429` — HTTP code ## Sample Response: HTTP 200 ### Resources removed from quarantine ```json { "message": "Selected system(s) have been removed from Quarantine successfully", "status": "success" } ``` ### Grace period extended for resources ```json { "message": "Selected system(s) have been extended from grace period successfully", "status": "success" } ``` ### Resources removed from exclusion list ```json { "message": "Selected system(s) have been removed from exclusion successfully", "status": "success" } ``` ### Exclusion period extended for resources ```json { "message": "Selected system(s) have been extended from exclusion successfully", "status": "success" } ``` ## Sample Response: HTTP 400 ### A request body parameter has an invalid format or type ```json { "errorCode": "IAM0025", "url": "/dcapi/compliance/quarantine/onDemand", "errorMsg": "resourceIds is an invalid parameter format." } ``` ## Sample Response: HTTP 401 ### Authentication credentials are missing or invalid ```json { "errorMessage": "Authentication required", "errorCode": "UNAUTHORIZED" } ``` ## Sample Response: HTTP 403 ### User lacks ALL_MANAGED_COMPUTER_ROLE permission ```json { "errorMessage": "Verify if the user is granted permissions to manage all computers!", "errorCode": "RESOURCE_NOT_IN_SCOPE" } ``` ### Quarantine is not available in VMP Professional Edition ```json { "errorMessage": "You do not have enough permission to perform this action. Upgrade to Enterprise Edition to use these features.", "errorCode": "FORBIDDEN" } ``` ## Sample Response: HTTP 429 ### API call threshold exceeded ```json { "errorMessage": "Rate limit exceeded. Retry after some time", "errorCode": "TOO_MANY_REQUESTS" } ``` ## Rate Limiting ![](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.