Deactivate Device

Remove a device registration (hostId) from a license key (licenseKey), freeing up an activation slot. Specify a hostId to remove a particular device, or omit it to deactivate all devices associated with the license key.

Endpoint

POST /deactivate-key

Base URL: https://docs/api.keymint.dev

Request Details

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

ParameterTypeRequiredDescription
productIdstringYesUnique product identifier (e.g., prod_...).
licenseKeystringYesLicense key string (e.g., lk_...).
hostIdstringNoUnique identifier of the device to deactivate. If omitted, all devices for this key are deactivated.

Example Requests

Deactivate a Specific Device

POST /deactivate-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"
}

Deactivate All Devices

POST /deactivate-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"
}

Responses

The API returns a JSON object confirming the deactivation.

Success Response (200 OK)

{
  "message": "Device deactivated",
  "code": 0
}

Error Responses

Status CodeCodeDescriptionExample Response Body
4001Missing required parameters (productId, licenseKey).{"message": "Missing required params", "code": 1}
4011Invalid or missing accessToken in the Authorization header.{"message": "Invalid access token", "code": 1}
4032License is not active (cannot deactivate if already inactive).{"message": "License not activated", "code": 2}
4041productId, licenseKey, or specific hostId (if provided) not found.{"message": "Device not found", "code": 1}
5001Internal server error during deactivation.{"message": "Server error", "code": 1}