Skip to main content

Errors

The Licentric API uses standard HTTP status codes and returns a consistent error response format for all error conditions.

Error Response Format

All error responses share the same JSON envelope: a human-readable message in error, a machine-readable code you can branch on, optional structured details (Zod issues, rate-limit metadata, etc.), and a requestId you can quote when filing a support ticket. The HTTP status itself is on the response, not the body.

Error Response (envelope)
{
  "error": "Human-readable description of the error",
  "code": "ERROR_CODE",
  "details": { "issues": [{ "path": ["productId"], "message": "Required", "code": "invalid_type" }] },
  "requestId": "01J8X3W4Y5Z6A7B8C9D0EFGHJK"
}

Example Errors

Validation Error

400Invalid request body
json
{
  "error": "Validation failed",
  "code": "VALIDATION_ERROR",
  "details": {
    "issues": [
      { "path": ["productId"], "message": "Required", "code": "invalid_type" }
    ]
  }
}

Authentication Error

401Missing or invalid credentials
json
{
  "error": "Invalid or expired API key",
  "code": "UNAUTHORIZED"
}

Conflict Error

409Invalid state transition
json
{
  "error": "Cannot suspend a revoked license",
  "code": "CONFLICT"
}

HTTP Status Codes

StatusTitleDescription
400Bad RequestThe request body failed validation. Check the error message for details on which fields are invalid.
401UnauthorizedMissing or invalid authentication credentials. Verify your API key or license key.
403ForbiddenThe authenticated key lacks the required scopes for this operation.
404Not FoundThe requested resource does not exist or has been soft-deleted.
409ConflictInvalid state transition. For example, attempting to suspend an already-revoked license.
422Unprocessable EntityThe request is syntactically valid but violates a business rule, such as exceeding machine limits.
429Too Many RequestsRate limit exceeded. Check the Retry-After header for when to retry.
500Internal Server ErrorAn unexpected error occurred. If this persists, contact support.