EYMINT
DocumentationAPI Reference
BlogDashboard
EYMINT
SectionsDocumentationAPI Reference
Go to Dashboard

For AI agents: the documentation index is at /llms.txt. Every docs page is also available as markdown by adding .md to its URL.

Overview

  • API Introduction
  • API Reference Overview
  • Authentication
  • Rate Limits
  • Error Codes

Customers

  • Create Customer
  • Get All Customers
  • Get Customer
  • Update Customer
  • Get Customer Keys
  • Toggle Status
  • Delete Customer

License Keys

  • Create Key
  • Get Key Info
  • Update Key
  • Activate Key
  • Sign Offline Key
  • Checkout Floating Session
  • Heartbeat Floating Session
  • Checkin Floating Session
  • Deactivate Key
  • Block Key
  • Unblock Key
  • Delete Key

Error Codes

Complete list of Keymint REST API error codes, HTTP status mapping, and troubleshooting recommendations.

Response Structure

Success responses have code: 0:

json
{
  "code": 0,
  "message": "License valid"
}

Every error has a top-level message (string), a non-zero code (integer) and a stable errorCode (string):

json
{
  "message": "Invalid license key or insufficient permissions",
  "code": 1,
  "errorCode": "license_invalid_or_forbidden"
}

Branch on errorCode. It never changes for a given situation. message is written for people and may be reworded, so don't match on its text.

Some errors also carry success: false and an error object with a legacy string code: validation errors (VALIDATION_ERROR), the per-action rate limit on activate, checkout and sign (RATE_LIMIT_EXCEEDED) and unknown endpoints (NOT_FOUND). The 405 body carries error as the plain string "Method not allowed". Validation messages always name the field: Field '<name>' is required. or Field '<name>': <problem>.

json
{
  "success": false,
  "message": "Field 'licenseKey' is required.",
  "code": 1,
  "errorCode": "invalid_request",
  "error": { "code": "VALIDATION_ERROR", "message": "Field 'licenseKey' is required." }
}

Read the message from message and branch on errorCode (or, in older integrations, on the HTTP status and then code). code: 0 only ever accompanies a successful response. Fields may be added to error bodies over time, so ignore any you don't use.

Error Codes (errorCode)

errorCodeHTTPcodeMeaning
api_key_missing4011No Authorization: Bearer <key> header
api_key_invalid4011The API key is unknown, expired or revoked, or its scope or product binding doesn't allow this endpoint
api_key_no_workspace4031The API key isn't associated with a workspace
ip_not_allowed4031The API key has an IP allowlist and this request's address isn't on it
forbidden4031The action isn't allowed for this workspace or key (the message says why): a plan limit, an archived product, or a missing permission such as license:manage to delete a customer who holds keys
license_invalid_or_forbidden4011Activate, sign and checkout, once the API key is accepted: the license is unknown, expired, blocked, assigned to a disabled customer, the wrong license type, or not allowed on this device. Deliberately one answer, see below. Heartbeat and checkin answer session_invalid instead
license_not_found4041Admin and read endpoints: no license with this key for the product
activation_limit_reached4032The license is already active on maxActivations devices
licensee_not_allowed4032A licensee can't be assigned on the workspace's plan
offline_license_held4091The device holds an unexpired offline license, so its activation is kept; the body includes offlineValidUntil
floating_seats_full4034Every floating seat is in use; the body includes currentSessions and maxSessions
session_invalid4011Floating heartbeat, checkin or repeat checkout with a wrong signature, stale nonce or unknown session
session_expired4105The floating session is unknown, was checked in, or expired; call POST /key/checkout again
product_not_found4041No active product with this ID in the workspace
customer_not_found4031The customer ID isn't in this workspace
not_found4041No customer with this ID in the workspace (customer endpoints), or no endpoint at this path
subscription_required4022The vendor's workspace needs an active subscription for this operation (the message names it)
license_archived4022Archived licenses can't be re-enabled
plan_selection_required4022The workspace must renew or finish the Free-plan resource selection first
invalid_request4001A parameter is missing, invalid or over its maximum length or value, or the body isn't valid JSON (the message names the field)
payload_too_large4131The request body is over 64 KB
method_not_allowed4051The endpoint doesn't support this HTTP method
rate_limited4291 or 3Too many requests; code: 3 (nested shape) for every route rate limit on /key/activate, /key/checkout and /key/sign
quota_exceeded4291The Free plan's monthly API request limit is reached
conflict4092A conflicting record already exists (for example a customer with the same email); retry or fix the input
retry4091The device was deactivated while its offline license was being signed (/key/sign); try again
idempotency_in_progress4091A request with this Idempotency-Key is still running
idempotency_mismatch4001The Idempotency-Key was reused for a different request
idempotency_legacy4091An old idempotency record can't be replayed; reconcile the original operation
idempotency_unavailable5031The idempotency service is temporarily unavailable; retry the same request
service_unavailable5031A dependency is temporarily unavailable; retry
server_error5001Unexpected server error; contact support if it persists

Request Limits

A request body over 64 KB (65,536 bytes) gets 413 payload_too_large. This applies to every POST, PUT, PATCH and DELETE, and is checked from Content-Length before anything else runs. Every field also has a maximum; going outside a limit returns 400 invalid_request naming the field.

FieldLimits
productId22–256 characters
licenseKey (body, query or x-license-key header)20–256 characters
customerId (request body)22–256 characters
hostId, deviceTag1–64 characters
name (customers, newCustomer, licensee)3–255 characters after trimming; no URLs or control characters
email3–320 characters, a valid address
metadata10,000 characters when serialized as JSON
maxActivationsA whole number up to 1,000,000, or "unlimited"; as text at most 20 characters. On create, omitted, null or "" means unlimited; on update, null or "unlimited" means unlimited
maxConcurrentSessions1–1,000,000
heartbeatInterval60–86,400 seconds
sessionLeaseDuration300–31,536,000 seconds
amountKeys1–256
allowedHosts100 entries of up to 255 characters
expiryDate, versionId64 characters
formatsections 1–10, sectionLength 1–32, separator 3, prefix/suffix 16, charset 2–100 with no whitespace; the format must give at least 60 bits of entropy
ttl (/key/sign)60–315,360,000 seconds (10 years)
userIdentifier (/key/checkout)255 characters
sessionId1–255 characters
Idempotency-Key header (or X-Idempotency-Key)1–255 printable ASCII characters
timestamp (the floating nonce)128 characters
signatureExactly 64 hex characters
GET /customer limit1–100 (larger values are capped at 100)

Numeric Codes

CodeMeaning
0Success
1General error (see the HTTP status)
2License or subscription constraint: activation limit reached, licensee not allowed, workspace subscription required, archived license, or a conflicting record
3Per-action rate limit on /key/activate, /key/checkout, and /key/sign (every route rate limit on those three endpoints)
4Floating seat limit reached (/key/checkout)
5Floating session ended; check out again (/key/heartbeat, /key/checkin)

Error Reference

HTTPCodeWhen
4001Missing or invalid parameters (VALIDATION_ERROR names the field), a body that isn't valid JSON, hostId missing on deactivate with a client key, hostId or TTL missing for offline signing, or an Idempotency-Key reused with a different request
4011api_key_missing (no Authorization header) or api_key_invalid (Invalid API key or insufficient permissions): the key is invalid, expired, revoked, or its scope or product binding doesn't allow the endpoint
4011license_invalid_or_forbidden (activate, sign, checkout) — the license is unknown, expired, blocked, assigned to a disabled customer, the device is not in allowedHosts, or the key's license type doesn't match the endpoint
4011session_invalid — floating heartbeat or checkin with a wrong signature or stale nonce, a license that can't be used, or a repeat checkout without a valid signature
4022The vendor's workspace has no active subscription for this operation
4032activation_limit_reached (the license is already active on maxActivations devices) or licensee_not_allowed (the plan can't take another customer for an activation's licensee claim)
4034Floating checkout with every seat in use; the body includes currentSessions and maxSessions
4031ip_not_allowed (license endpoints; customer endpoints return the generic 401), api_key_no_workspace, customer_not_found, or forbidden (plan limit, archived product, or a missing permission)
4041product_not_found, license_not_found (admin and read endpoints, and deactivate when the device isn't activated), not_found for an unknown customer ID or an unknown path (error.code is NOT_FOUND)
4051The endpoint doesn't support this HTTP method
4091 / 2A request with the same Idempotency-Key is still in progress or can't be replayed (1), a device holds an offline license (offline_license_held, 1, with offlineValidUntil), the device was deactivated while signing (retry, 1), or a conflicting record already exists (conflict, 2)
4105Floating session unknown, checked in or expired — call POST /key/checkout again
4131The request body is over 64 KB
4291 / 3Rate limit or monthly quota exceeded — see Rate Limits
5001Unexpected server error — contact support if persistent
5031Authorization or idempotency service temporarily unavailable — retry the same request

Why license failures look the same

Expired, blocked, unknown, and wrong-device licenses all return the same 401 response on purpose, so a leaked API key can't be used to probe which license keys exist or what state they're in. Treat any 401 from activation as "this license can't be used on this device" and show the user a recovery path (re-enter the key, contact support). To see why a specific license fails, look it up from your server with GET /key using a read-only or admin key, or open it in the dashboard.

Handling Errors

Distinguish a license the server rejected from a request that didn't get an answer. Only the first should lock the user out; for the second, keep the last known state and retry later.

javascript
const res = await fetch('https://api.keymint.dev/key/activate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ productId, licenseKey, hostId })
});

const data = await res.json();
const message = data.message;

if (res.ok) {
  // Activated — data.code === 0
} else if ([401, 402, 403, 404].includes(res.status)) {
  // License rejected: invalid/expired/blocked key, wrong device,
  // vendor subscription lapsed, activation limit reached, or the
  // product was deactivated (404 product_not_found). Branch on
  // data.errorCode for the exact reason, never on the message text.
} else if (res.status === 429) {
  // Back off for Retry-After seconds, then retry
} else {
  // 5xx: keep the cached license state and retry later
}

The official SDKs never return a non-2xx response as a normal result. The Node.js and Python SDKs throw an error with status and code; the Go SDK returns an *ApiError with Status and Code; the C# SDK returns a result with IsSuccess == false and the details in Error. Apply the same rules in that branch.

Never expose raw API error messages to end users. Map them to user-friendly messages in your application.

On this page

  • Response Structure
  • Error Codes (`errorCode`)
  • Request Limits
  • Numeric Codes
  • Error Reference
  • Why license failures look the same
  • Handling Errors