# CreateLicenseKey

Create license key for this account

`POST /api/v2/accounts/{id}/licensekey`

**API:** AvaTax API
**Tag:** Accounts
**API Version:** v2
**Base URL:** https://sandbox-rest.avatax.com/
**Content-Type:** `application/json`
**Accepts:** `application/json`
**Authentication:** API Key (`Authorization` in header) or OAuth 2.0 or Basic (username + license key)

Source: https://developer.avalara.com/products/avatax/api/methods/Accounts/CreateLicenseKey/

## Description

Creates a new license key for this account.
            
To create a license key for your account, you must specify the ID of the account and license key name.
            
This API is only available to account administrators for the account in question, and may only be called after
an account has been activated by reading and accepting Avalara's terms and conditions.  To activate your account
please log onto the AvaTax website or call the `ActivateAccount` API.
            
You will reference this key using license key name. The existing license key will be using 'Default' as license key name.
Hence make sure that the license key name is unique per account considering the existing license key name 'Default'

### Security Policies

* This API requires one of the following user roles: AccountAdmin, AvaTaxOnlyAccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.

## Parameters

| Name | Type | In | Required | Description |
|---|---|---|---|---|
| `id` | integer | path | Yes | The ID of the account you wish to update. |
| `X-Avalara-Client` | string | header | No | Identifies the software you are using to call this API.  For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) . |

## Request Body

**Schema:** `AccountLicenseKeyModel`

An account user who is permitted to use AvaTax.

| Property | Type | Required | Description |
|---|---|---|---|
| `name` | string | **Yes** | The unique name for license key per account Example: `ABCDEFGHIJK`. |
| `accountId` | integer | **Yes** | AccountId for required license key Example: `123456789`. |
| `createdDate` | string | No | The date when this record was created. Example: `2026-07-02T00:00:00+00:00`. |
| `createdUserId` | integer | No | The user id for the user who created this record. Example: `1`. |
| `modifiedDate` | string | No | The date/time when this record was last modified. Example: `2026-07-02T00:00:00+00:00`. |
| `modifiedUserId` | integer | No | The user id of user who last modified this record. Example: `1`. |

## Responses

| Status | Description | Schema |
|---|---|---|
| 200 | Success | `LicenseKeyModel` |
| 400 | Bad Request |  |
| 401 | Unauthorized |  |
| 404 | Not Found |  |

### 200 Response: `LicenseKeyModel`

Represents a license key for this account.

| Property | Type | Required | Description |
|---|---|---|---|
| `accountId` | integer | No | The primary key of the account Example: `123456789`. |
| `privateLicenseKey` | string | No | This is your private license key.  You must record this license key for safekeeping.
If you lose this key, you must contact the ResetLicenseKey API in order to request a new one.
Each account can only have one license key at a time. Example: `742A02AA463CDE741E932EC365360CA3CF378BD9`. |
| `httpRequestHeader` | string | No | If your software allows you to specify the HTTP Authorization header directly, this is the header string you
should use when contacting Avalara to make API calls with this license key. Example: `Basic MTIzNDU2Nzg5Ojc0MkEwMkFBNDYzQ0RFNzQxRTkzMkVDMzY1MzYwQ0EzQ0YzNzhCRDk=`. |

## Example Request

```bash
curl -X POST "https://sandbox-rest.avatax.com/api/v2/accounts/{id}/licensekey" \
  -H "Authorization: Basic <credentials>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
  "name": "ABCDEFGHIJK",
  "accountId": 123456789,
  "createdDate": "2026-07-02T00:00:00+00:00",
  "createdUserId": 1,
  "modifiedDate": "2026-07-02T00:00:00+00:00",
  "modifiedUserId": 1
}'
```