> ## 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.

# Deactivate

> This method will 'undo' a key activation with a certain machine code. The key should not be blocked, since otherwise this method will throw an error.

This method will 'undo' a [key activation](/api-reference/generated/Activate) with a certain machine code. The key should not be blocked, since otherwise this
method will throw an error.

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

### Parameters

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| ProductId | the product id (=\*\*\[ProductId] \*\*) | required |
| Key | the serial key string | required |
| MachineCode | The machine code (a string that identifies a device) for activation. | optional. empty string by default. |
| Floating | When true, this will release the floating license (without removing it from the list of node-locked licenses). | optional. false by default. |
| OSInfo | Additional OS related information (as a string) that will be registered as metadata in [Register Event](/api-reference/generated/RegisterEvent). | optional. null by default. |
| v | Method version. | optional. by default, it's 1. |

### Results

| **Parameter** | **Description** | **Remarks** |
| - | - | - |
| Result | This is either **0**(=success) or **1**(=error). | always returned |
| Message | The message that provides additional information about the result. | always returned. |

### Example results

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

### Remarks

* When a machine code does not exist (for example, if was never activated or deactivated at some point), an error will be thrown in the node-locking case only (e.g. when you call this method with default parameters and Floating=false). However, if floating licensing is used (i.e. Floating=true), then an error will not be thrown even if the machine code does not exist.

### Errors

| **Error** |
| - |
| Access denied. |
| The input parameters were incorrect. |
| Could not find the product. |
| Could not find the key. |
| The key is blocked and cannot be accessed. |
| Either the machine code was never activated or key activation feature was never set up. |

### FAQ

#### Can one token activate and deactivate a license?

**Yes. Select both Activate and Deactivate when creating or editing your personal access token.**
Activate permission alone does not grant Deactivate. The pre-generated QuickStart token permits Activate and GetKey, but not Deactivate.
Both calls must still satisfy their parameters and the token's applicable restrictions. See the
[access-token guide](https://help.cryptolens.io/getting-started/access-token) for the controls and recommended configurations.
