---
title: Apply a DataRobot license
description: Learn how to apply a DataRobot license using either the user interface of DataRobot's API.
platform: self-managed-only

---

# Apply a DataRobot license {: #apply-a-datarobot-license }

This page explains how to apply a DataRobot license using either the application interface or the DataRobot API. Note that this workflow is exclusive to administrators, and requires you to be logged into DataRobot with admin permissions.

## Apply a license in the DataRobot application {: #apply-a-license-in-the-datarobot-application }

1. Access the DataRobot cluster in your browser.

2. Click the profile icon in the top-right corner of the page and select **License**.

    ![](images/license-1.png)

3. On the **License** page, enter the license key in the field and click **Validate**.

    ![](images/license-2.png)

4. After validating, DataRobot lists the features and functionality included in the subscription (blurred in the image below).

    ![](images/license-3.png)

5. Confirm that the validated license lists the correct subscription features, then click **Submit**.

## Apply a license via the API {: #apply-a-license-via-the-api }

Alternatively, administrators can validate a DataRobot license using DataRobot's REST API. To do so, provide your information in the snippet below and execute a REST API call.

``` shell
# Set the URI of the DataRobot App node
# Ex. https://datarobot.example.com
# Ex. http://10.2.3.4
dr_app_node="http://10.2.3.4"

# If you have a username and password, start here
# Set the initial username
admin_username=localadmin@datarobot.com

# Set the local administrator user password
admin_password=""

# Read the license
ldata=$(cat ./license.txt)

# Apply the license with the following commands

# Log in to the App Node
curl --silent -X POST \
  --cookie "/tmp/cookies.txt" \
  --cookie-jar "/tmp/cookies.txt" \
  -H "Content-Type: application/json" \
  -d '{"username":"'"${admin_username}"'","password":"'"${admin_password}"'"}' \
  ${dr_app_node}/account/login

# Get an API key
api_key=$(curl --silent -X POST \
  --cookie "/tmp/cookies.txt" \
  --cookie-jar "/tmp/cookies.txt" \
  -H "Content-Type: application/json" \
  -d '{"name":"apiKey"}' \
  ${dr_app_node}/api/v2/account/apiKeys/ | cut -d ',' -f 5 | cut -d '"' -f 4)

# Apply the license
curl --silent -w "%{http_code}\n" -X PUT \
  -H "Content-Type: application/json" \
  -H "HTTP/1.1" \
  -H "Authorization: Token ${api_key}}" \
  -d '{"licenseKey":"'"${ldata}"'"}' \
  ${dr_app_node}/api/v2/clusterLicense/

# Expected output: 200
```
