# Generate a license key using the API

Source: https://developer.avalara.com/products/ecm/integration-guides/document-management/nnn3449005212513/

Guide: Exemption Certificate Management (ECM)

# Generate a license key using the API

Learn how to generate a license key using the AccountResetLicenseKey API.

To generate a license key using the [AccountResetLicenseKey API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Accounts/AccountResetLicenseKey/), provide a valid account ID and set the `confirmResetLicenseKey` flag to `true`.

```
curl
    -X POST
    -H 'Accept: application/json'
    -H 'Authorization: Basic ${btoa(`:`)}'
    -H 'Content-Type: application/json'
    --data '{
      "accountId": 123456789,
      "confirmResetLicenseKey": true
    }'
    'https://sandbox-rest.avatax.com/api/v2/accounts/{id}/resetlicensekey'
```

**Parent topic:** [License key authentication](/document-management/jwg4610283771454/ "Learn how to use license keys for AvaTax account authentication.")