Skip to main content

Error Codes

All YorAuth API errors follow a consistent response envelope. This page catalogues every error code, its HTTP status, and how to resolve it.

Error Response Format

json
{
  "error": {
    "code": "AUTH_INVALID_CREDENTIALS",
    "message": "The email or password you entered is incorrect.",
    "details": {
      "field": "password",
      "reason": "password_mismatch"
    },
    "request_id": "req_1a2b3c4d5e6f",
    "timestamp": "2026-02-25T12:00:00Z",
    "documentation_url": "https://docs.yorauth.com/errors/auth-invalid-credentials"
  }
}
FieldTypeDescription
error.codestringMachine-readable error code (uppercase snake_case)
error.messagestringHuman-readable message suitable for display
error.detailsobjectOptional additional context (field errors, retry info)
error.request_idstringUnique identifier — include this when contacting support
error.timestampstringISO 8601 timestamp when the error occurred
error.documentation_urlstringLink to documentation for this error

HTTP Status Codes

StatusWhen used
400 Bad RequestInvalid request syntax, missing fields, malformed values
401 UnauthorizedAuthentication required or failed
403 ForbiddenAuthenticated but not authorized
404 Not FoundResource does not exist
409 ConflictDuplicate resource or conflicting operation
410 GoneToken or code has expired
422 Unprocessable EntitySemantically invalid request
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorUnexpected server error
502 Bad GatewayUpstream provider error
503 Service UnavailableMaintenance or temporary outage

Authentication Errors (AUTH_*)

CodeHTTPDescriptionResolution
AUTH_INVALID_CREDENTIALS401Wrong email or passwordCheck email and password
AUTH_TOKEN_EXPIRED401Access token has expiredCall the refresh token endpoint
AUTH_TOKEN_INVALID401JWT is malformed, has an invalid signature, or wrong audienceObtain a new token via login
AUTH_TOKEN_REVOKED401The session token has been explicitly revokedUser must log in again
AUTH_INVALID_REFRESH_TOKEN401Refresh token is invalid, expired, or already usedUser must log in again
AUTH_ACCOUNT_LOCKED429Account temporarily locked after excessive failed login attemptsWait for lockout to expire or reset password
AUTH_ACCOUNT_SUSPENDED403Account has been suspended by an administratorContact support
AUTH_EMAIL_NOT_VERIFIED403Email address has not been verifiedCheck email for verification link
AUTH_MFA_REQUIRED401Login requires MFA completionSubmit TOTP code via the verify MFA endpoint
AUTH_INVALID_MFA_CODE401TOTP code or backup code is incorrectCheck code in authenticator app
AUTH_MFA_CHALLENGE_EXPIRED410MFA challenge token has expiredStart login again
AUTH_MFA_LOCKED429Too many failed MFA attemptsWait before retrying
AUTH_INVALID_RESET_TOKEN400Password reset token is invalid or does not match the emailRequest a new reset link
AUTH_RESET_TOKEN_EXPIRED410Password reset token has expiredRequest a new reset link
AUTH_INVALID_VERIFICATION_TOKEN400Email verification token is invalidRequest a new verification email
AUTH_VERIFICATION_TOKEN_EXPIRED410Email verification token has expiredRequest a new verification email
AUTH_VERIFICATION_RATE_LIMITED429Too many verification email requestsWait before requesting again
AUTH_INVALID_MAGIC_LINK400Magic link token is invalid or has already been usedRequest a new magic link
AUTH_MAGIC_LINK_EXPIRED410Magic link token has expiredRequest a new magic link
AUTH_MAGIC_LINK_RATE_LIMITED429Too many magic link requestsWait before requesting again
AUTH_PASSWORD_RESET_RATE_LIMITED429Too many password reset requestsWait 15 minutes before requesting again

Validation Errors (VALIDATION_*)

These errors occur when request data fails validation. The details field includes field-level information.

CodeHTTPDescriptionResolution
VALIDATION_REQUIRED_FIELD400A required field is missingInclude the required field
VALIDATION_INVALID_FORMAT400A field value does not match the expected formatFix the field value
VALIDATION_MULTIPLE_ERRORS400Multiple fields failed validationFix all errors listed in details.errors
VALIDATION_PASSWORD_TOO_WEAK422Password does not meet the security policyChoose a stronger password (min 8 chars, mixed case, number, special character)
VALIDATION_PASSWORD_COMPROMISED422Password found in known breach databaseChoose a different password

Validation Error Detail Format

When there are multiple validation errors, the details field contains an array:

json
{
  "error": {
    "code": "VALIDATION_MULTIPLE_ERRORS",
    "message": "The request contains multiple validation errors.",
    "details": {
      "errors": [
        {
          "field": "email",
          "code": "VALIDATION_INVALID_FORMAT",
          "message": "The email field has an invalid format."
        },
        {
          "field": "password",
          "code": "VALIDATION_REQUIRED_FIELD",
          "message": "The password field is required."
        }
      ]
    },
    "request_id": "req_jkl789",
    "timestamp": "2026-02-25T12:00:00Z"
  }
}

Resource Errors (RESOURCE_*)

CodeHTTPDescriptionResolution
RESOURCE_NOT_FOUND404The requested resource does not existVerify the resource ID
RESOURCE_ALREADY_EXISTS409A resource with that identifier already existsUse a different identifier or retrieve the existing resource
RESOURCE_CONFLICT409The operation conflicts with the current state of the resourceResolve the conflict before retrying

Authorization Errors (AUTHZ_*)

CodeHTTPDescriptionResolution
AUTHZ_PERMISSION_DENIED403The authenticated token lacks the required permissionRequest permission from an administrator
AUTHZ_ROLE_NOT_FOUND404The referenced role does not existVerify the role ID
AUTHZ_ROLE_ALREADY_ASSIGNED409The role is already assigned to this user with the same scopeNo action needed — role is already active
AUTHZ_ROLE_ASSIGNMENT_NOT_FOUND404No matching role assignment found for the given user and scopeVerify the user ID, role ID, and scope

Resource-Specific Errors

CodeHTTPResourceDescription
USER_NOT_FOUND404UserUser does not exist in this application
SESSION_NOT_FOUND404SessionSession not found or already revoked
WEBHOOK_NOT_FOUND404WebhookWebhook configuration not found
API_KEY_NOT_FOUND404API KeyAPI key not found
API_KEY_ALREADY_REVOKED409API KeyAPI key has already been revoked
INVALID_PASSWORD422UserPassword verification failed (for change-password, disable MFA)
MFA_INVALID_CODE422MFATOTP code is incorrect during setup confirmation
MFA_NOT_ENABLED400MFAMFA must be enabled before generating backup codes

OAuth Errors (OAUTH_*)

CodeHTTPDescriptionResolution
OAUTH_PROVIDER_ERROR502The upstream OAuth provider returned an errorRetry after a delay; contact support if persistent
OAUTH_CONNECTION_NOT_FOUND404No OAuth connection found for this user and providerConnect the provider first
OAUTH_STATE_MISMATCH400OAuth CSRF state parameter does not matchRestart the OAuth flow

Rate Limit Errors (RATE_LIMIT_*)

CodeHTTPDescriptionResolution
RATE_LIMIT_EXCEEDED429Request rate limit exceededWait for the Retry-After period before retrying

Rate limit responses include headers:

text
X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1708864800
Retry-After: 60

Server Errors (SERVER_*)

CodeHTTPDescriptionResolution
SERVER_INTERNAL_ERROR500Unexpected server errorRetry the request; include the request_id when contacting support
SERVER_MAINTENANCE503Service temporarily unavailable for maintenanceCheck the Retry-After header for estimated completion

Tier / Billing Errors

CodeHTTPDescriptionResolution
tier_limit_exceeded403Application user or resource limit reached for current planUpgrade your plan or remove unused resources
resource_limit_exceeded403Application count limit reached for current planUpgrade your plan

OIDC Protocol Errors

OIDC endpoints return OAuth 2.0 / OIDC standard error codes (not the AUTH_* format):

ErrorHTTPDescription
invalid_client400Client not found or inactive
invalid_request400Missing or invalid request parameter
invalid_scope400Requested scope is not allowed
invalid_grant400Authorization code or refresh token is invalid
unsupported_grant_type400Grant type is not supported