Deactivate
Easily 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
HTTP Request
- Method:
POST
- Endpoint:
/deactivate-key
- Base URL:
https://api.keymint.dev
- Authorization: Bearer token in the
Authorization
header
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
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 | No | Unique identifier of the device to deactivate. If omitted, all devices for this key are deactivated. | min: 1 , max: 64 |
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", // or "All devices deactivated"
"code": 0
}
Error Responses
Status Code | Code | Description | Example Response Body |
---|---|---|---|
400 | 1 | Missing required parameters (productId , licenseKey ). | {"message": "Missing required params", "code": 1} |
401 | 1 | Invalid or missing accessToken in the Authorization header. | {"message": "Invalid access token", "code": 1} |
403 | 2 | License is not active (cannot deactivate if already inactive). | {"message": "License not activated", "code": 2} |
404 | 1 | productId , licenseKey , or specific hostId (if provided) not found. | {"message": "Device not found", "code": 1} |
500 | 1 | Internal server error during deactivation. | {"message": "Server error", "code": 1} |
➡️ See Also: Error Codes for a complete list of error codes.