> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Key From Template

> This method will create a license key based on a License Template. If you want to see all the defined license templates through the API, this can be accomplished with [Get License...

This method will create a license key based on a [License Template](https://app.cryptolens.io/LicenseTypes). If you want to see all the defined license templates through the API, this can
be accomplished with [Get License Templates](/api-reference/generated/GetLicenseTemplates). An alternative is to call the [Create Key](/api-reference/generated/CreateKey) method, which allows you to specify all the parameters yourself.

**Note:** the "feature lock" field in the access token can be used to restrict which license tempalte id can be used.

This method is accessed by [https://api.cryptolens.io/api/key/CreateKeyFromTemplate](https://api.cryptolens.io/api/key/CreateKeyFromTemplate)

### Parameters

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| LicenseTemplateId | The id of the license template. | required |
| v | Method version. | optional. by default, it's 1. |

### Results

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| Result | This is either **0**(=success) or **1**(=error). | always returned |
| Key | The license key string of the newly generated license | always returned |
| RawResponse | Properties extracted from the underlying API response, formatted as JSON. | always returned |
| Message | The message that provides additional information about the result. | always returned. |

### Example results

```text theme={null}
{"key":"MWYXE-VBPFS-OMNDM-GRJRY","rawResponse":"{\"key\":\"MWYXE-VBPFS-OMNDM-GRJRY\",\"result\":\"Success\",\"message\":null}","result":0,"message":null}
```

### Errors

| **Error** |
| - |
| Access denied. |
| The input parameters were incorrect. |
| The specified template id is not allowed because feature lock. Please use an access token with feature lock set to 0 or set it to the id of the license template. |
| Could not find the license template. |
| Could not find the key. |
