# Install All Missing Patches in Specific Systems ## Endpoint `POST /api/1.4/patch/installpatch` ## Request ### Request URL `https://{server-hostname}:8383/api/1.4/patch/installpatch` ### Scope `PatchMgmt.CREATE` ### Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ### Request Body `application/json` #### JSON object - **isOnlyApproved** (`string`, Optional): (Optional): true = deploy only approved patches, false = deploy all - **ResourceIDs** (`JSON array`, Optional): Enter the list of resources with missing patches in your network, E.g. `ResourceIDs:[601,602]` - **PatchIDs** (`JSON array`, Optional): Enter the list of missing patches detected in your network, E.g. `PatchIDs:[103980,103981,103980]` - **ConfigName** (`string`, Optional): Provide a name for the Install Patch configuration, **E.g. ConfigName:API install patch test1** - **ConfigDescription** (`string`, Optional): Provide a description for the Install Patch configuration, **E.g. ConfigDescription:API test** - **actionToPerform** (`string`, Optional): This will initiate deployment of the defined Install Patches Configuration to the specified targets in accordance with the provided criteria, **E.g. actionToPerform:Deploy/ Deploy Immediately/ Draft**, **Deploy:** The deployment will initiate upon the agent's contact with the server, **Deploy Immediately:** Deployed instantly without waiting for agent contact, **Draft:** Save the configuration as a draft. - **DeploymentPolicyTemplateID** (`long`, Optional): Retrieve the Deployment Policy ID by executing the following API, **`/api/1.4/patch/deploymentpolicies`** and and provide the value of the **template_id** param value. - **installaftertime** (`string`, Optional): Specify the date and time for patch installation to begin. Patches will be installed based on the selected options after the scheduled time. Use the format: **yyyy-MM-dd HH:MM**. - **expirytime** (`string`, Optional): This configuration will not be applied after the specified time. Use the format **yyyy-MM-dd HH:MM**. - **deploymentType** (`string`, Optional): Provide the preferred deployment option here. Accepted values: 0/1/2, E.g. **deploymentType: 0/1/2**. - **0** - Deploy only (default). This option enables you to deploy the selected patches to the targeted endpoints according to the relevant deployment policies. - **1** - Publish in Self Service Portal only (DeploymentPolicyTemplateID will be ignored). This option enables administrators to publish the selected patches to the Self Service Portal. End users and server owners can then initiate the installation process at their convenience. - **2** - This option incorporates both deployment and publication actions. Note: If deploymentType is set to 0 or 1, then the DeploymentPolicyTemplateID field is mandatory. - **deadlineTime** (`long`, Optional): Specify the time, in milliseconds, for force deploying the patches to unpatched systems in your network, **E.g. deadlineTime: 1691393760 (Time in milliseconds)**. Note: Max of 1 year is supported. - **forceRebootOption** (`string`, Optional): Depending on the selected Deployment Policy, you can choose to enable Force Reboot either within or outside the deployment window. Accepted Values: 0/1/2, **E.g. forceRebootOption:0/1/2**. - **0** - Not configured. - **1** - Within the deployment/reboot window. - **2** - Outside the deployment/reboot window. - **resourceNames** (`JSON array`, Optional): Specify the required list of resource names for deployment ex:`resourceNames:[win-1422,wind-144d]` - **customGroups** (`JSON array`, Optional): Specify the required list of Custom Group names for deployment ex:`customGroups:[cg-1,cg-2]` - **remoteOffices** (`JSON array`, Optional): Specify the required list of Ip addresses for deployment ex:`remoteOffices:[Local Office,Remote-1]` - **ipAddresses** (`JSON array`, Optional): Specify the required list of Custom Group names for deployment ex:`ipAddresses:[127.0.0.1,126.0.0.1]` - **retrySettings** (`JSON object`, Optional): Enabling this option will redeploy the configuration on failed targets. **E.g. `"retrySettings":{"enableRetrySettings": true,"noOfRetries": 2,"logonStartupMinRetry": 1,"refreshMinRetry": 1}`** - **enableRetrySettings**: true: To enable retry settings, false: To disable retry settings. - **noOfRetries**: Total number of retries count. Accepted values 1-10. - **logonStartupMinRetry**: Retry during system startup. - **refreshMinRetry**: Retry during refresh cycle. - **Note**: Enabled by default. To disable, set `enableRetrySettings` to false. Retry count: logonStartupMinRetry + refreshMinRetry. ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/1.4/patch/installpatch \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{"retrySettings":{"logonStartupMinRetry":1,"noOfRetries":2,"refreshMinRetry":1,"enableRetrySettings":true},"deploymentType":2,"deadlineTime":1691393760,"isOnlyApproved":"true","ConfigName":"API install patch test1","ResourceIDs":[601],"actionToPerform":"Deploy","ConfigDescription":"API test","forceRebootOption":2,"DeploymentPolicyTemplateID":1}' ``` ## Sample Request Body ```json { "retrySettings": { "logonStartupMinRetry": 1, "noOfRetries": 2, "refreshMinRetry": 1, "enableRetrySettings": true }, "deploymentType": 2, "deadlineTime": 1691393760, "isOnlyApproved": "true", "ConfigName": "API install patch test1", "ResourceIDs": [ 601 ], "actionToPerform": "Deploy", "ConfigDescription": "API test", "forceRebootOption": 2, "DeploymentPolicyTemplateID": 1 } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` #### JSON object ## Possible Response Codes - **200** (`HTTP code`) ## Sample Response: HTTP 200 ```json { "message_type": "installpatch", "message_response": { "installpatch": {} }, "message_version": "1.4", "status": "success" } ``` ## API Rate Limits ![ ](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.