# Deploy a configuration from a template Creates and deploys a new configuration from the specified template to the given targets. Optionally supports immediate deployment. ## Endpoint `POST /dcapi/configuration/deploy/template` ## Request ### Request URL `https://{serverurl}/dcapi/configuration/deploy/template` ### Scope `DesktopCentralCloud.Configurations.CREATE`, `DesktopCentralCloud.SWDeployment.CREATE`, `DesktopCentralCloud.PatchMgmt.CREATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ### Request Parameters #### Request Headers - **Content-Type** `string` — **Mandatory** `application/deployConfigurationTemplate.v1+json` - **Accept** `string` — **Mandatory** `application/configDeployTemplateStatus.v1+json` #### Request Body `application/json` - **templateId** `long` — Optional Mandatory. The unique ID of the configuration template to deploy. Fetch from [List Configuration Templates](https://www.manageengine.com/products/desktop-central/help/api/cloud/deployment-fw-list-templates.html). - **targets** `JSON Object` — Optional Mandatory. Single target descriptor identifying where the configuration should be deployed. See child keys. - **deployImmediate** `boolean` — Optional Optional. When true, the configuration is deployed immediately to all targets. When false (default), the configuration will be picked up by the agent in the next refresh cycle. ### Sample Request ```curl curl --request POST \ --url https://appdomains/dcapi/configuration/deploy/template \ --header 'Accept: application/configDeployTemplateStatus.v1+json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/deployConfigurationTemplate.v1+json' \ --data '{}' ``` ### Sample Request Body #### Deploy template immediately to specific computer resources ```json { "deployImmediate": true, "templateId": 2001, "targets": { "isDomainMainTarget": false, "values": [ 301, 302, 303 ], "type": "computer" } } ``` #### Deploy template to a custom group (next agent refresh) ```json { "templateId": 2001, "targets": { "values": [ 9001, 9002 ], "type": "custom-group" } } ``` ## Response Parameters ### HTTP Code 200 Response body: `application/json` - **collectionId** `long` The unique ID of the newly created configuration collection from the template deployment. - **collectionName** `string` Display name of the created configuration. - **configType** `string` The configuration type (e.g., computer or user). - **addedUser** `string` Username of the technician who initiated the deployment. #### Sample Response: HTTP 200 Template deployed successfully creating a new configuration. ```json { "configType": "computer", "collectionId": 50001, "addedUser": "admin", "collectionName": "Firewall_Policy_Win11" } ``` ### HTTP Code 400 Response body: `application/json` - **error_code** `string` `CONFIG_INVALID_INPUT_DATA`: request payload is missing required fields (`templateId`, `targets`), or contains unsupported collectionType 2. - **error_description** `string` Message describing the specific validation failure in the request payload. #### Sample Response: HTTP 400 Request payload missing required `templateId` field. ```json { "error_description": "Required fields are missing in the request payload", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` CollectionType 2 is not supported by this API. ```json { "error_description": "The API does not support collectionType 2", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ### 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 #### Sample Response: HTTP 401 User lacks required write role or scope. ```json { "error_description": "Access denied - You are not allowed to access the requested resource.", "error_code": "UAC_UNAUTHORIZED" } ``` ### HTTP Code 413 Response body: `application/json` - **error_code** `string` `CONFIG_INVALID_INPUT_DATA`: server storage limit exceeded, unable to create the configuration from template. - **error_description** `string` Message indicating insufficient storage space for the deployment. #### Sample Response: HTTP 413 Server storage limit exceeded. ```json { "error_description": "Insufficient storage space to deploy the configuration", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ### HTTP Code 500 Response body: `application/json` - **error_code** `string` `SERVICE_NOT_AVAILABLE`: unexpected error during template resolution or configuration deployment. - **error_description** `string` Message describing the internal server error encountered during deployment. #### Sample Response: HTTP 500 Unexpected failure during template deployment. ```json { "error_description": "An unexpected error occurred. Please try again later.", "error_code": "SERVICE_NOT_AVAILABLE" } ``` ## Rate Limit ![Help](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.