API Reference Overview
Welcome to the Keymint API reference. Here you will find the base URL, authentication standards, response structures, and HTTP error codes.
The Keymint API is organized around REST. All requests must use HTTPS, accept JSON-formatted payloads, and return JSON responses. Request bodies are limited to 64 KB; a larger body gets 413 with errorCode: "payload_too_large".
Base URL
All requests must be made to the following base URL:
https://api.keymint.devAuthentication
Every API request requires authentication using a Bearer token in the Authorization header. You can generate API keys with scoped permissions in the developer settings.
curl https://api.keymint.dev/customer \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Keep your API keys secure. Do not share them or use them in client-side code that executes in a browser environment.
Response Format
Successful responses are JSON objects with code: 0. The other fields depend on the endpoint; for example, POST /key/activate returns:
{
"code": 0,
"message": "License valid",
"expirationDate": "2027-03-01T00:00:00.000Z",
"licenseeName": "J*** D**",
"licenseeEmail": "j***@example.com",
"metadata": { "hostId": "mac-studio-m2" }
}When an error occurs, the API returns an HTTP error status with an error payload:
{
"message": "Activation limit reached",
"code": 2,
"errorCode": "activation_limit_reached"
}Branch on errorCode; message is for people and may be reworded. Some errors also keep an older nested error object ({ "success": false, "error": { "code", "message" } }) next to these fields. See Error Codes for every code.
HTTP Status Codes
The API uses standard HTTP response codes to indicate the success or failure of an API request.
| Code | Status | Description |
|---|---|---|
200 | OK | The request succeeded and the response payload is returned. |
400 | Bad Request | The request was invalid or missing required parameters, or a field is outside its limits. The message names the field. |
401 | Unauthorized | The API key is missing, invalid, expired, or not allowed for this endpoint — or the license can't be used (unknown, expired, blocked, or this device isn't allowed). |
402 | Payment Required | The vendor's workspace has no active subscription for this operation. |
403 | Forbidden | Activation or floating seat limit reached, a licensee claim or other change the plan doesn't allow, a customer from another workspace, or the API key isn't allowed from this IP address. |
404 | Not Found | The product, license, customer or endpoint does not exist. |
405 | Method Not Allowed | The endpoint doesn't support this HTTP method. |
409 | Conflict | A request with the same Idempotency-Key is in progress, a conflicting record exists, or the device holds an unexpired offline license. |
410 | Gone | The floating session ended; check out again. |
413 | Payload Too Large | The request body is over 64 KB. |
429 | Too Many Requests | The client has exceeded rate limits. |
500 | Internal Error | An error occurred on Keymint's servers. |
503 | Service Unavailable | A dependency is temporarily unavailable; retry the same request. |
Versioning & Deprecation Policy
The Keymint API is versioned by date, and the version is declared in two places you can rely on:
- Webhook payloads carry an
api_versionfield ("2026-06-21"format) so consumers always know which contract produced an event. - OpenAPI spec (
https://keymint.dev/openapi.json) declares the current semantic version ininfo.version.
Policy:
- Backward-compatible changes (new optional fields, new endpoints, new response headers) ship without notice inside the current version.
- Breaking changes (renamed/removed fields, changed response shapes, new required parameters) are introduced only in a new dated contract and announced in the changelog and release emails at least 30 days before the old contract stops working.
- Deprecation signaling: deprecated endpoints and fields are listed in the changelog with a removal timeline. No endpoint is deprecated today, and the API doesn't currently send
DeprecationorSunsetHTTP headers. - The current API surface is documented by the OpenAPI spec — treat the spec as the contract, and your integration as stable when it consumes only fields declared there.
Idempotency
Mutating endpoints (POST, PUT, PATCH, DELETE) support safe retries by passing an Idempotency-Key (or X-Idempotency-Key) header. This prevents duplicate resource creation (for example generating license keys twice) if the connection drops. The floating endpoints POST /key/checkout, /key/heartbeat and /key/checkin ignore the header: each of them proves possession of the session, so their responses are never stored or replayed.
- Key Format: A fresh random UUID (v4) for each operation, reused only to retry that same operation. Never derive it from the license key or host ID: a replay returns the original response, including generated license keys. The key must be 1 to 255 printable ASCII characters: a longer value, or one with other characters, returns
400 Bad Request(invalid_request) before anything runs. - Expiry: The daily cleanup removes idempotency records older than 24 hours; deletion occurs on the next successful cleanup run.
- Request Verification: Reusing a key with a different HTTP method, path, query target or body returns
400 Bad Request. Independent query parameter order is normalized; duplicate value order and exact body text matter. - Response Replay: Retries preserve the original status, body and Content-Type, including generated license keys. Cached responses are encrypted at rest.
- Unavailable Cache: Cache setup or replay failures return
503without running the mutation. A result-save failure leaves the reservation in progress (409on retry); reconcile the original operation before using a new key. - Upgrade: Legacy records cannot safely prove query identity or restore previously stripped keys. They return
400(legacy request hash) or409(missing encrypted response). Reconcile the original operation before issuing another mutation. - Concurrent Lock: If you send duplicate requests with the same key simultaneously before the first one completes, the second request will return a
409 Conflict.
Example Request
curl -X POST https://api.keymint.dev/key \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" \
-d '{"productId": "YOUR_PRODUCT_ID", "maxActivations": 3}'Core Concepts
Understanding the basic resources before making API requests:
- Products: The software titles you distribute.
- Customers: The entities that purchase or lease your licenses.
- License Keys: Unique alphanumeric identifiers specifying seat limits and flags.
- Activations: Links binding a license key to a specific device via a
hostId.
Next Steps
- Authenticate your integration: Authentication
- Handle rate-limiting: Rate Limits
- Inspect standard errors: Error Codes