API endpoint reference
Every License Web REST API endpoint with its parameters, response fields and an example cURL request.
This reference describes each License Web REST API endpoint. For how the endpoints fit together, see the REST API overview and Example use cases.
Base URL and authentication#
All endpoints are under your License Web URL and API route:
https://lcweb.yourdomain.com/restapi/
The examples use restapi as the API route and lcweb.yourdomain.com as the host. Replace them with your own URL and, if you changed it, your API route (see API and routing). Both http and https work, depending on how you publish License Web.
Send these headers with every request:
| Header | Value |
|---|---|
ApiKey |
The API key of your key pair. |
ApiSecret |
The API secret of your key pair. |
Content-Type |
application/json |
Responses#
All endpoints use the same response pattern unless stated otherwise:
| Result | Status code | Body |
|---|---|---|
| Success | 200 OK |
A success message or the result of the request. |
| Error | 4xx or 5xx, depending on the error |
The error message and, where available, error codes. |
If a parameter does not match the data in License Web, the error message is Key not found.
Endpoints#
| Method | Path | Purpose |
|---|---|---|
POST |
/restapi/addkeys |
Add one or more product keys. |
PATCH |
/restapi/activatelicense |
Activate a product key. |
PATCH |
/restapi/deactivatelicense |
Deactivate a product key. |
PATCH |
/restapi/setTrialInfo |
Set trial information for a key. |
PATCH |
/restapi/setExpiryDate |
Set the expiry date of a key. |
GET |
/restapi/getTrialInfo |
Get trial information for a key. |
GET |
/restapi/getExpiryDate |
Get the expiry date of a key. |
GET |
/restapi/getlicensestatus |
Get the current status of a key. |
POST /restapi/addkeys#
Adds one or more product keys. The request body is a JSON array, so you can add several keys in one call.
| Parameter | Type | Required | Description |
|---|---|---|---|
productName |
string | No | The name of the product. |
productCode |
string | Yes | The code of the product. |
customerName |
string | No | The customer's name. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key. |
isTrial |
boolean | No | Whether the key is for a trial version. |
duration |
integer | No | How long the key is valid, in minutes. |
uid |
string | No | A unique identifier for the request. |
sendEmail |
boolean | No | Whether to email the key to the customer. |
expireAt |
string or null | No | Expiry date of the key in ISO 8601 format, for example 2024-12-31T23:59:59Z. |
curl --location 'https://lcweb.yourdomain.com/restapi/addkeys' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"productName": "lcweb",
"productCode": "lcweb",
"customerName": "Ben Williams",
"email": "williams@outlook.com",
"productKey": "ABCD-ABCD-ABCD-010B",
"isTrial": false,
"duration": 0,
"uid": "2K-3G-70-CI-9X-70",
"sendEmail": true,
"expireAt": "2024-12-31T23:59:59Z"
}
]'
PATCH /restapi/activatelicense#
Activates a product key.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key to activate. |
uid |
string | No | A unique identifier for the request, such as the machine or host ID. |
curl --location --request PATCH 'https://lcweb.yourdomain.com/restapi/activatelicense' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"productCode": "lcweb",
"email": "williams@outlook.com",
"productKey": "ABCD-ABCD-ABCD-010B",
"uid": "2K-3G-70-CI-9X-70"
}'
PATCH /restapi/deactivatelicense#
Deactivates a product key.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key to deactivate. |
curl --location --request PATCH 'https://lcweb.yourdomain.com/restapi/deactivatelicense' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"productCode": "lcweb",
"email": "williams@outlook.com",
"productKey": "ABCD-ABCD-ABCD-010B"
}'
PATCH /restapi/setTrialInfo#
Sets trial information for a product key.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key to set trial information for. |
isTrial |
boolean | No | Whether the key is for a trial version. |
duration |
integer | No | How long the key is valid, in minutes. |
uid |
string | No | A unique identifier for the request. |
curl --location --request PATCH 'https://lcweb.yourdomain.com/restapi/setTrialInfo' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"productCode": "lcweb",
"email": "williams@outlook.com",
"productKey": "ABCD-ABCD-ABCD-010B",
"isTrial": true,
"duration": 1000,
"uid": "2K-3G-70-CI-9X-70"
}'
PATCH /restapi/setExpiryDate#
Sets the expiry date of a product key.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key to set the expiry date for. |
uid |
string | No | A unique identifier for the request. |
expireAt |
DateTime | No | The expiry date of the key. Include the time zone offset, for example 2024-09-12T14:51:00+05:30. |
curl --location --request PATCH 'https://lcweb.yourdomain.com/restapi/setExpiryDate' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"productCode": "lcweb",
"email": "williams@outlook.com",
"productKey": "ABCD-ABCD-ABCD-010B",
"expireAt": "2024-09-12T14:51:00+05:30",
"uid": "2K-3G-70-CI-9X-70"
}'
GET /restapi/getTrialInfo#
Gets trial information for a product key. Send the parameters in the query string.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key. |
uid |
string | No | A unique identifier for the request. Required if you sent a uid when you activated the key. |
curl --location 'https://lcweb.yourdomain.com/restapi/getTrialInfo?ProductCode=LCWEB&ProductKey=9KAZ-VKU9-2IJ6-HT20&Email=williams@outlook.com&UID=2K-3G-70-CI-9X-70' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json'
Response (200 OK):
{
"isTrial": true,
"duration": 1500
}
| Field | Type | Description |
|---|---|---|
isTrial |
boolean | true if the licence is a trial licence. |
duration |
integer | The trial duration in minutes. |
GET /restapi/getExpiryDate#
Gets the expiry date of a product key. Send the parameters in the query string.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key. |
uid |
string | No | A unique identifier for the request. |
curl --location 'https://lcweb.yourdomain.com/restapi/getExpiryDate?ProductCode=LCWEB&ProductKey=9KAZ-VKU9-2IJ6-HT20&Email=williams@outlook.com&UID=2K-3G-70-CI-9X-70' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json'
Response (200 OK) for a key that has an expiry date:
{
"expireAt": "2024-09-23T00:00:11.8793055+05:30"
}
| Field | Type | Description |
|---|---|---|
expireAt |
DateTime | The date and time the key expires. |
Response (200 OK) for a key with no expiry date: the body is Never Expires.
GET /restapi/getlicensestatus#
Gets the current status of a product key. Send the parameters in the query string.
| Parameter | Type | Required | Description |
|---|---|---|---|
productCode |
string | Yes | The code of the product. |
email |
string | Yes | The customer's email address. |
productKey |
string | Yes | The product key. |
uid |
string | No | A unique identifier for the request. Required if you sent a uid when you activated the key. |
curl --location 'https://lcweb.yourdomain.com/restapi/getlicensestatus?ProductCode=LCWEB&ProductKey=9KAZ-VKU9-2IJ6-HT20&Email=williams@outlook.com&UID=2K-3G-70-CI-9X-70' \
--header 'ApiKey: YOUR_API_KEY' \
--header 'ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json'
Response (200 OK):
{
"productKey": "9KAZ-VKU9-2IJ6-HT20",
"status": "Activated"
}
| Field | Type | Description |
|---|---|---|
productKey |
string | The product key from the request. |
status |
string | The current status of the key: Entry, Activated, Deactivated or Expired. |