Skip to content

API Error Codes

EaseLab APIs use standard HTTP status codes with JSON error bodies. Lab routes (/lab/*) wrap errors in the ApiResponse envelope; auth and some admin routes return simpler objects.

HTTP status codes

CodeMeaningWhen used
200OKSuccessful request
201CreatedResource created (rare; most use 200)
204No ContentSuccessful delete/logout
400Bad RequestValidation failure, business rule violation
401UnauthorizedMissing/invalid token, bad credentials
403ForbiddenInsufficient permissions, tenant locked
404Not FoundResource does not exist
422Unprocessable EntityAnalyzer ingest parse failure
429Too Many RequestsRate limit exceeded
500Internal Server ErrorUnexpected server error

Response shapes

Lab API error (envelope)

json
{
  "requestId": "trace-id",
  "timeStampUtc": "2026-06-26T10:00:00Z",
  "success": false,
  "exception": false,
  "message": "Invoice not found.",
  "data": null
}

Auth error (simple)

json
{ "message": "Invalid email or password." }

Tenant read-only lock

HTTP 403 with extended body:

json
{
  "message": "Your lab is in read-only mode. Subscribe to restore full access.",
  "code": "TENANT_READONLY",
  "readonlyMode": true,
  "tenant": {
    "name": "My Lab",
    "slug": "my-lab",
    "paymentStatus": "Unpaid",
    "isLocked": true
  }
}

Common error messages

MessageCauseResolution
Invalid email or password.Bad login credentialsCheck email/password
Verify your email before signing in.Unverified accountComplete email verification
Refresh token is missing.No cookie on refreshRe-login
Invalid or expired refresh token.Expired/revoked sessionRe-login
You do not have permission to perform this action.Missing RBAC permissionContact admin
Resource not found.Invalid IDVerify resource exists
Invalid invoice number or access code.Public lookup failedCheck patient details
Invalid or missing analyzer API key.Bad X-Analyzer-KeyReconfigure device
Impersonation code expired or invalid.Code > 2 min or reusedStart new impersonation
Your free trial has ended...Trial expiredSubscribe via billing
Your subscription period has ended...Subscription lapsedRenew plan

Validation errors

FluentValidation failures on auth routes return 400:

json
{ "message": "Password must be at least 8 characters." }

Field-level validation may include errors object in future versions.

Analyzer ingest errors

HTTP 422:

json
{
  "message": "Could not match barcode SAMPLE-999.",
  "logId": "guid-for-support"
}

Use logId when contacting support — it links to the ingestion log.

Client handling recommendations

StatusClient action
401Attempt refresh; if fails, redirect to login
403 + TENANT_READONLYShow billing prompt; allow reads only
403 (permission)Show access denied UI
404Show not-found state
429Retry with exponential backoff
500Show generic error; include requestId in support tickets

Debugging

Include the requestId from any error response when reporting issues. It maps to server trace logs.

Ease Lab — Cloud Pathology Lab Management