Activate
Registers a specific device (hostId
) to a license key (licenseKey
), consuming an activation slot if applicable. This endpoint validates the license key and associated product/customer, then adds the device information if activation is possible. Use this during initial software setup or when activating on a new device.
Endpoint
- Method:
POST
- Endpoint:
/activate-key
- Base URL:
https://api.keymint.dev
- Authorization: Bearer token in the
Authorization
header
Request
Send a POST
request with a JSON body and Content-Type: application/json
. Include the accessToken
as a Bearer token in the Authorization
header.
Headers
Header | Value | Required | Description |
---|---|---|---|
Authorization | Bearer <accessToken> | Yes | API access token for authentication. |
Body Parameters
Parameter | Type | Required | Description | Constraints |
---|---|---|---|---|
productId | string | Yes | Unique product identifier (e.g., prod_... ). | min: 22 , max: 256 |
licenseKey | string | Yes | License key string (e.g., lk_... ). | min: 23 , max: 256 |
hostId | string | Yes | Unique device identifier (e.g., MAC hash, UUID). | min: 1 , max: 64 |
deviceTag | string | No | Optional user-friendly device name (e.g., "John's Laptop"). | min: 1 , max: 64 |
Example Request
POST /activate-key HTTP/1.1
Host: api.keymint.dev
Authorization: Bearer at_verylongaccesstokenstringgeneratedforyourapplication12345678
Content-Type: application/json
{
"productId": "your_product_id_123",
"licenseKey": "xxxxx-xxxxx-xxxxx-xxxxx",
"hostId": "a1:b2:c3:d4:e5:f6-hashed-uuid-or-other-id",
"deviceTag": "Dev Workstation"
}
Responses
The API returns a JSON object with the activation status.
Success Response (200 OK)
Indicates the license is valid for the device. It differentiates between a new activation and a pre-existing one for the same hostId
.
{
"code": 0,
"message": "License valid",
"licensee_name": "Jane Doe",
"licensee_email": "jane.doe@example.com"
}
Note: The response structure reflects the code's return values. Fields like
activated
,status
, andexpiry date
are not included.
Error Responses
Status Code | Code | Description | Example Response Body |
---|---|---|---|
400 | 1 | Missing required parameters (productId , licenseKey , hostId ). | {"message": "Missing required params", "code": 1} |
401 | 1 | Invalid accessToken . | {"message": "Invalid access token", "code": 1} |
403 | 2 | License not active, expired, customer inactive, or activation limit reached. | {"message": "Activation limit reached", "code": 2} |
404 | 1 | productId or licenseKey not found, or customer associated with key not found. | {"message": "Invalid license key", "code": 1} |
500 | 1 | Internal server error during activation. | {"message": "Server error", "code": 1} |
➡️ See Also: Error Codes for a complete list of error codes.