Skip to content
The API is in beta and may change without prior notice.

Error Codes

HitKey returns structured error responses. This page lists all error codes by category.

Response Format

Most error responses follow this structure:

json
{
  "error": "Human-readable description",
  "code": "ERROR_CODE"
}

AdonisJS validation errors (HTTP 422) use an array format:

json
{
  "errors": [
    {
      "message": "Validation failed",
      "rule": "required",
      "field": "email"
    }
  ]
}

Authentication Errors

CodeHTTPDescription
INVALID_CREDENTIALS401Wrong email or password
EMAIL_NOT_VERIFIED401Email not yet verified

2FA Errors

CodeHTTPDescription
INVALID_CODE400Wrong TOTP code
SETUP_NOT_INITIATED4002FA not configured for this user
NOT_ENABLED4002FA is not enabled (cannot disable)
INVALID_TOKEN400Challenge token is invalid or expired

Email Management Errors

CodeHTTPDescription
EMAIL_ALREADY_IN_USE400Email is registered to another account
INVALID_CODE400Wrong verification code
CODE_EXPIRED400Verification code has expired
TOO_MANY_ATTEMPTS400Maximum verification attempts exceeded
EMAIL_NOT_FOUND404Email not associated with this account
EMAIL_NOT_VERIFIED400Email is not yet verified
ONLY_VERIFIED_EMAIL400Cannot delete the only verified email address

Profile Errors

CodeHTTPDescription
USERNAME_INVALID400Username format is invalid
USERNAME_RESERVED400Username is reserved by the system
USERNAME_TAKEN409Username is already in use

Registration Errors

CodeHTTPDescription
EMAIL_ALREADY_VERIFIED400This email is already verified
INVALID_CODE400Wrong verification code
TOO_MANY_ATTEMPTS400Maximum attempts exceeded (request a new code)
CODE_EXPIRED400Verification code has expired
NO_CODE400No pending verification for this email

Password Reset Errors

CodeHTTPDescription
INVALID_TOKEN400Reset token is invalid
TOKEN_EXPIRED400Reset token has expired

OAuth Errors

OAuth endpoints return human-readable error messages rather than structured error codes:

json
{
  "error": "Invalid client_id"
}

Common error messages:

MessageHTTPDescription
"Invalid client_id"400Unknown client_id
"redirect_uri doesn't match"400redirect_uri doesn't match registered URI
"Invalid or expired authorization code"400Code has already been used or expired

Project Errors

CodeHTTPDescription
NOT_PROJECT_MEMBER403User is not a member of the project
ALREADY_MEMBER400User is already a project member
CANNOT_TRANSFER_TO_SELF400Cannot transfer ownership to yourself
INVITE_ALREADY_EXISTS400An invite for this email already exists
INVITE_NOT_FOUND404Invite not found
INVITE_EXPIRED400Invite has expired
EMAIL_MISMATCH400User's email doesn't match invite email

HTTP Status Codes

StatusMeaning
200Success
201Created
202Accepted (2FA challenge)
400Bad request / validation error
401Not authenticated
403Forbidden (insufficient permissions)
404Not found
409Conflict (e.g., username taken)
422Unprocessable entity (validation)
429Too many requests
500Internal server error

HitKey Service License.