# Create Deployment Policy Creates a new deployment policy template with deployment window, pre-deployment, and post-deployment configurations. ## Endpoint `POST /dcapi/patch/deploymentPolicy` ## Request URL `https://`[*{serverurl}*](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)`/dcapi/patch/deploymentPolicy` ## Scope `DesktopCentralCloud.PatchMgmt.CREATE` ## Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Body `application/json` - **JSON Object** - **templateID** (`long`, Optional): Unique identifier of the deployment policy template - **templateName** (`string`, Optional): Name of the deployment policy template - **templateDesc** (`string`, Optional): Description of the deployment policy template - **templateInUse** (`boolean`, Optional): Whether this template is currently in use - **associatedModule** (`boolean`, Optional): Whether associated with a specific module - **filesize** (`long`, Optional): File size associated with the template in bytes - **deploymentDetails** (`JSON Object`, Optional): Deployment window configuration - **preDeploymentDetails** (`JSON Array`, Optional): List of pre-deployment activity configurations - **postDeploymentDetails** (`JSON Array`, Optional): List of post-deployment activity configurations ## Sample Request ### Curl ```curl curl --request POST \ --url https://appdomains/dcapi/patch/deploymentPolicy \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{}' ``` ## Sample Request Body Create a deployment policy with deployment window and pre/post activities ```json { "preDeploymentDetails": [ { "configName": "WOL_CONFIG", "performNoDeploymentSuccess": false, "isWOLEnabled": true, "proceedOnFailure": true } ], "deploymentDetails": { "enableStaging": false, "weekType": 1, "deploymentOption": 1, "timeZone": "Asia/Kolkata", "deploymentWindowSchedule": [ { "weeks": [ "1", "2", "3", "4" ], "months": [ "0", "1", "2" ], "days": [ "1", "2", "3", "4", "5" ], "startTime": "09:00", "stopTime": "18:00", "dates": [ "1", "15" ] } ] }, "postDeploymentDetails": [ { "configName": "POST_REBOOT_SHUTDOWN_CONFIG", "rebootNotificationMessage": "System will reboot after patching.", "rebootPreference": 1, "rebootNotificationTitle": "Reboot Required", "rebootMethod": 1, "rebootWindowSchedule": [ { "days": [ "6", "7" ], "startTime": "02:00", "stopTime": "05:00" } ], "skipRebootIfNotRequired": true, "forceRebootOption": 1, "rebootNotificationTimeout": 300, "excludeRebootForServers": true } ], "templateName": "My Deployment Policy", "templateDesc": "Description of the policy", "filesize": 1024 } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - **JSON Object** - **templateID** (`long`): Unique identifier of the created deployment policy template - **status** (`string`): Operation result: success ### HTTP Code 413 Response Body — `application/json` - **JSON Object** - **error_code** (`string`): Error code: CONFIG_DEPLOY_POLICY_INVALID for storage limit exceeded - **error_description** (`string`): Storage limit exceeded message ## Possible Response Codes - `200` — HTTP code - `413` — HTTP code ## Sample Response: HTTP 200 Deployment policy created ```json { "templateID": 12345, "status": "success" } ``` ## Sample Response: HTTP 413 Storage limit exceeded ```json { "error_description": "Storage limit exceeded", "error_code": "CONFIG_DEPLOY_POLICY_INVALID" } ``` ## Rate Limit **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.