# Saves the auto-update package cleanup policy settings Configures the cleanup policy for auto-update packages including enabling/disabling cleanup and specifying the number of recent package versions to retain. ## Endpoints **POST** `/dcapi/swDeployment/savePackageCleanupSettings` ## Request URL ```text https://{server-hostname}:8383/dcapi/swDeployment/savePackageCleanupSettings ``` ## Scope ```text SWDeployment.CREATE ``` ## Header ```text Authorization: d92d4xxxxxxxxxxxxx15f52 ``` ## Request Parameters ### Request Headers - **Content-Type** `string` **Mandatory**: `application/savePackageCleanup.v1+json` - **Accept** `string` **Mandatory**: `application/savePackageCleanup.v1+json` ### Request Body `application/json` - `JSON Object` - **isEnableAutoUpdateCleanup** `boolean` Optional: true to enable auto-update package cleanup, false to disable - **noOfRecentAutoUpdatePkgs** `integer` Optional: Number of recent auto-update package versions to retain per software (2-8) ## Sample Request ```curl curl --request POST \ --url https://appdomain/dcapi/swDeployment/savePackageCleanupSettings \ --header 'Accept: application/savePackageCleanup.v1+json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/savePackageCleanup.v1+json' \ --data '{"noOfRecentAutoUpdatePkgs":3,"isEnableAutoUpdateCleanup":true}' ``` ## Sample Request Body ### Enable cleanup, keep 3 recent ```json { "noOfRecentAutoUpdatePkgs": 3, "isEnableAutoUpdateCleanup": true } ``` ### Disable cleanup ```json { "noOfRecentAutoUpdatePkgs": 2, "isEnableAutoUpdateCleanup": false } ``` ## Response Parameters ### HTTP code 200 #### Response Body — application/json - `JSON Object` - **remarks** `string`: Human-readable result message ### HTTP code 500 #### Response Body — application/json - `JSON Object` - **errorCode** `string`: SW_INTERNAL_ERROR for cleanup settings failures, INTERNAL_ERROR for restore operation errors - **errorMessage** `string`: Internal server error with details about the cleanup policy or archive restore failure ## Possible Response Codes - **200** `HTTP code` - **500** `HTTP code` ## Sample Response: HTTP 200 ### Settings saved ```json { "remarks": "Package Cleanup Settings SuccessFully Updated" } ``` ## Sample Response: HTTP 500 ### Server error ```json { "errorMessage": "Internal Server Error", "errorCode": "SW_INTERNAL_ERROR" } ``` ## API 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.