Skip to content

Error codes

All errors follow the same envelope:

{
"error": {
"code": "activation_limit_exceeded",
"message": "This license key has reached its activation limit (3 of 3 devices).",
"details": { "limit": 3, "used": 3 },
"help": "https://docs.lizen.dev/api/errors"
}
}

Error reference

HTTPCodeDescriptionAction
400invalid_requestMalformed request, missing or invalid fieldFix the request body
401authentication_failedMissing, invalid, or revoked API keyCheck your API key
403forbiddenAPI key lacks the required scopeUse a key with the correct permissions
403account_suspendedAccount has been suspendedContact support@lizen.dev
404not_foundResource does not existCheck the ID
409conflictResource already exists (e.g. duplicate product slug)Change the slug
422key_revokedLicense key has been revokedShow user a message; direct to support
422key_expiredLicense key has expiredPrompt renewal
422activation_limit_exceededKey has reached its device limitDirect user to deactivate a device at the license portal
422plan_limit_exceededAccount has reached its plan’s resource limitUpgrade plan
429rate_limitedToo many requestsRespect retry_after (seconds) in the response
500internal_errorUnexpected server errorRetry with exponential backoff; check status.lizen.dev

Handling errors in the SDK

import { Lizen, PlanLimitError, RateLimitError } from '@lizen/sdk';
const lizen = new Lizen({ apiKey: process.env.LIZEN_API_KEY! });
try {
await lizen.keys.create({ productId: 'prod_abc', plan: 'pro' });
} catch (err) {
if (err instanceof PlanLimitError) {
// Account hit the key limit — prompt upgrade
showUpgradeBanner();
} else if (err instanceof RateLimitError) {
// Back off and retry
await sleep(err.retryAfter * 1000);
} else {
throw err;
}
}

Validation errors

Validation errors ({ valid: false }) are not HTTP errors — they return 200 with valid: false and a reason field. See Validate a key for the full list.