AUTHENTICATION_ERROR | 401 | Missing, malformed, or invalid token | Redirect to login |
TOKEN_EXPIRED | 401 | Access token has expired | Refresh the token, then retry the request |
AUTHORIZATION_ERROR | 403 | User’s role lacks permission for this endpoint | Show “access denied” message |
NOT_FOUND | 404 | The requested resource does not exist | Show “not found” or redirect |
VALIDATION_ERROR | 422 | Request body failed validation | Display field-level errors from details |
CONFLICT | 409 | Resource already exists (e.g. duplicate email) | Inform user of the conflict |
RATE_LIMIT_EXCEEDED | 429 | Too many requests in the time window | Back off and retry after a delay |
TENANT_ERROR | 400 | Tenant could not be resolved from the request | Check configuration / contact support |
EXTERNAL_SERVICE_ERROR | 502 | A downstream service (AI, LMS, etc.) failed | Retry or show a “try again later” message |
DATABASE_ERROR | 500 | Internal database failure | Retry or show a generic error |
INTERNAL_ERROR | 500 | Unhandled server error | Show a generic error message |