> ## 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 Trial Key

> This method creates a license key that is time-limited, node-locked and with the "Time-Limited" and "Trial" features set to true (which can be set by editing the...

This method creates a license key that is time-limited, [node-locked](https://help.cryptolens.io/licensing-models/node-locked)
and with the "Time-Limited" and "Trial" features set to true (which can be set by editing the [feature definitions](https://help.cryptolens.io/web-interface/feature-definitions) on the product page).
**Note**, by default, the trial will work for 15 days. To change this limit, you can set the **Feature Lock** to the desired value, when creating the access token.

If a trial key was already created for a certain machine code, this method will try to find the license key and return it instead.
However, this will only occur if the license key is still a trial key (based on feature definitions) and is not blocked.

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

### Parameters

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| ProductId | the product id (=\*\*\[ProductId] \*\*) | required |
| MachineCode | The machine code (a string that identifies a device) that this trial key will be locked to. Please note that the max length of the machine code is set to 128 chars. | optional. empty string by default. |
| FriendlyName | Allows you to specify a friendy name for the activated device, for example the employee's email. Friendly name does not impact the number of active machine codes / seats, but it offers an easy way of linking a machine/seat with a user. For added security, you can HMAC hash this value. | optional. empty string by default. |
| v | Method version. | optional. by default, it's 1. |

### Results

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| Key | The newly generated key | returned if no error occurred. |
| Result | This is either **0**(=success) or **1**(=error). | always returned |
| Message | The message that provides additional information about the result. If it's a successful result, either **null** or the **new key** (if using SKGL) will be returned. Otherwise, in case of an error, a short message will be returned describing the error. | always returned. |

### Example results

```text theme={null}
{"key":"ABCDE-ABCDE-ABCDE-ABCDE","result":0,"message":""}
```

### Errors

| **Error** |
| - |
| Access denied. |
| The input parameters were incorrect. |
| The notes field cannot be more than 500 characters. |
| Could not find the product. |
| Could not find the customer. |
| Creation of a license with x day(s) is not possible in SKGL. The limit is 999 days. |
| Generating more than 99,999 keys is not possible in SKGL. |
