Reference
Error codes
All error codes emitted by Auth Service, with HTTP status and default message.
Error codes
Auth Service uses a structured error response format for all API errors:
{
"error": {
"code": "APP_002",
"message": "Application not found",
"details": {}
}
}
details is included only when there are validation errors to report (e.g. Zod parse failures).
Authentication (AUTH_)
| Code | HTTP | Default message |
|---|---|---|
AUTH_001 | 401 | Missing or invalid authentication token |
AUTH_002 | 401 | Token expired |
AUTH_003 | 401 | Invalid credentials |
AUTH_004 | 401 | MFA required |
AUTH_005 | 401 | Invalid MFA code |
AUTH_006 | 403 | Account disabled |
AUTH_007 | 429 | Too many login attempts |
AUTH_008 | 400 | Invalid or expired password reset token |
AUTH_009 | 400 | Password too weak |
AUTH_010 | 409 | Email already registered |
Application (APP_)
| Code | HTTP | Default message |
|---|---|---|
APP_001 | 400 | Invalid application data |
APP_002 | 404 | Application not found |
APP_003 | 409 | Application slug already exists |
APP_004 | 400 | Cannot delete application with active users |
APP_005 | 403 | User does not have access to this application |
Permissions (PERM_)
| Code | HTTP | Default message |
|---|---|---|
PERM_001 | 400 | Invalid permission format |
PERM_002 | 404 | Role not found |
PERM_003 | 404 | Permission not found |
PERM_004 | 409 | Role name already exists in this application |
PERM_005 | 409 | Permission already defined |
PERM_006 | 400 | Cannot delete role assigned to active users |
Subscriptions (SUB_)
| Code | HTTP | Default message |
|---|---|---|
SUB_001 | 404 | Subscription plan not found |
SUB_002 | 409 | User already has an active subscription |
SUB_003 | 400 | Plan has active subscribers, cannot delete |
SUB_004 | 400 | Subscription expired |
Consumption (CONS_)
| Code | HTTP | Default message |
|---|---|---|
CONS_001 | 400 | Invalid key format |
CONS_002 | 400 | Value must be a finite number |
CONS_003 | 404 | User and application combination not found |
CONS_004 | 403 | Caller not authorized (requires client_credentials) |
Users (USR_)
| Code | HTTP | Default message |
|---|---|---|
USR_001 | 404 | User not found |
USR_002 | 400 | Cannot delete the last superadmin |
USR_003 | 400 | Invalid user data |
Server (SRV_)
| Code | HTTP | Default message |
|---|---|---|
SRV_001 | 500 | Internal server error |
SRV_002 | 503 | Service temporarily unavailable |
SRV_003 | 500 | Database error |