# 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 `https://`[{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html)`/dcapi/configuration/{collectionId}/saveAsTemplate` ### Scope `DesktopCentralCloud.Configurations.CREATE` ### Header `Authorization: Zoho-oauthtoken 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/cloud/deployment-fw-get-configurations-view.html). ### Sample Request ```curl curl --request POST \ --url https://appdomains/dcapi/configuration/{collectionId}/saveAsTemplate \ --header 'Accept: application/collnTemplateDetails.v1+json' \ --header 'Authorization: Zoho-oauthtoken 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 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 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 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 Server storage limit exceeded ```json { "error_description": "Insufficient storage space to create the template", "error_code": "INTERNAL_SERVER_ERROR" } ``` ## 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.