# Save an existing configuration as a reusable template Saves the specified configuration as a template for future reuse across deployments. ## Endpoint **POST** `/dcapi/configuration/{collectionId}/saveAsTemplate` ## Request ### Request URL ```text https://{server-hostname}:8383/dcapi/configuration/{collectionId}/saveAsTemplate ``` ### Scope ```text Configurations.CREATE ``` ### Header ```text Authorization: d92d4xxxxxxxxxxxxx15f52 ``` ### Request Parameters #### Request Headers - **Accept** (`string`, Mandatory): `application/collnTemplateDetails.v1+json` #### Path Parameters - **collectionId** (`string`, Mandatory): The unique numeric identifier of the configuration to be saved as a reusable template. Fetch from [Get Configurations View](https://www.manageengine.com/products/desktop-central/help/api/onpremise/deployment-fw-get-configurations-view.html). ### Sample Request ```curl curl --request POST \ --url https://appdomain/dcapi/configuration/{collectionId}/saveAsTemplate \ --header 'Accept: application/collnTemplateDetails.v1+json' \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` `JSON object` - **templateId** (`long`): The unique ID of the newly created template - **status** (`string`): Human-readable confirmation message #### Sample Response: HTTP 200 Template created successfully from existing configuration ```json { "templateId": 2001, "status": "Template created successfully." } ``` ### HTTP Code 400 Response Body: `application/json` `JSON object` - **error_code** (`string`): SERVICE_NOT_AVAILABLE: the configuration was created from a Global Template and save-as-template is restricted for MSP - **error_description** (`string`): Message indicating Global Template restriction prevents save-as-template #### Sample Response: HTTP 400 Configuration was created from a Global Template ```json { "error_description": "Configuration created from a Global Template cannot be saved as template", "error_code": "SERVICE_NOT_AVAILABLE" } ``` ### 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 #### Sample Response: HTTP 401 User lacks write role ```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` `JSON object` - **error_code** (`string`): INTERNAL_SERVER_ERROR: storage limit exceeded on the server to create the template - **error_description** (`string`): Message indicating insufficient storage space to create the template #### Sample Response: HTTP 413 Server storage limit exceeded ```json { "error_description": "Insufficient storage space to create the template", "error_code": "INTERNAL_SERVER_ERROR" } ``` ## Possible Response Codes - **200**: HTTP code - **400**: HTTP code - **401**: HTTP code - **413**: HTTP code ## 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.