# 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 URL ```text https://{server-hostname}:8383/dcapi/configuration/deploy/template ``` ## Scope ```text Configurations.CREATE ``` (or) ```text SWDeployment.CREATE ``` (or) ```text PatchMgmt.CREATE ``` ## Header ```text Authorization: d92d4xxxxxxxxxxxxx15f52 ``` ## Request Parameters ### Request Headers - **Content-Type** `string` — **Mandatory** - `application/deployConfigurationTemplate.v1+json` - **Accept** `string` — **Mandatory** - `application/configDeployTemplateStatus.v1+json` ### Request Body `application/json` - `JSON object` - **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/onpremise/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 curl --request POST \ --url https://appdomain/dcapi/configuration/deploy/template \ --header 'Accept: application/configDeployTemplateStatus.v1+json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/deployConfigurationTemplate.v1+json' \ --data '{"deployImmediate":true,"templateId":2001,"targets":{"isDomainMainTarget":false,"values":[301,302,303],"type":"computer"}}' ``` ## 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` - `JSON object` - **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. ### HTTP Code 400 Response Body — `application/json` - `JSON object` - **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. ### HTTP Code 401 Response Body — `application/json` - `JSON object` - **errorCode** `long` - Unauthorized error code returned when authentication credentials are missing, expired, or invalid (`authentication=required`) - **errorMsg** `string` - Authentication failure reason ### HTTP Code 413 Response Body — `application/json` - `JSON object` - **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. ### HTTP Code 500 Response Body — `application/json` - `JSON object` - **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. ## Possible Response Codes - **200** — HTTP code - **400** — HTTP code - **401** — HTTP code - **413** — HTTP code - **500** — HTTP code ## Sample Response: HTTP 200 ### Template deployed successfully creating a new configuration ```json { "configType": "computer", "collectionId": 50001, "addedUser": "admin", "collectionName": "Firewall_Policy_Win11" } ``` ## 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" } ``` ## 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" } ``` ## Sample Response: HTTP 413 ### Server storage limit exceeded ```json { "error_description": "Insufficient storage space to deploy the configuration", "error_code": "CONFIG_INVALID_INPUT_DATA" } ``` ## 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 ![](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.