Skip to main content

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

HTTP Request
  • 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

HeaderValueRequiredDescription
AuthorizationBearer <accessToken>YesAPI access token for authentication.

Body Parameters

ParameterTypeRequiredDescriptionConstraints
productIdstringYesUnique product identifier (e.g., prod_...).min: 22, max: 256
licenseKeystringYesLicense key string (e.g., lk_...).min: 23, max: 256
hostIdstringYesUnique device identifier (e.g., MAC hash, UUID).min: 1, max: 64
deviceTagstringNoOptional 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, and expiry date are not included.


Error Responses

Status CodeCodeDescriptionExample Response Body
4001Missing required parameters (productId, licenseKey, hostId).{"message": "Missing required params", "code": 1}
4011Invalid accessToken.{"message": "Invalid access token", "code": 1}
4032License not active, expired, customer inactive, or activation limit reached.{"message": "Activation limit reached", "code": 2}
4041productId or licenseKey not found, or customer associated with key not found.{"message": "Invalid license key", "code": 1}
5001Internal server error during activation.{"message": "Server error", "code": 1}

➡️ See Also: Error Codes for a complete list of error codes.