Skip to content

Error Codes Reference

All API errors follow a consistent format:

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

Authentication Errors

CodeHTTP StatusDescription
MISSING_API_KEY401X-API-Key header is missing
INVALID_API_KEY401The provided API key is invalid or doesn't exist
ACCOUNT_DISABLED403Your business account has been disabled
MISSING_AUTH401Authorization header is missing (admin routes)
INVALID_TOKEN401Invalid admin token
NOT_AUTHENTICATED401Request is not authenticated

Examples

Missing API Key:

json
{
  "success": false,
  "error": {
    "code": "MISSING_API_KEY",
    "message": "X-API-Key header is required"
  }
}

Invalid API Key:

json
{
  "success": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API key"
  }
}

Validation Errors

CodeHTTP StatusDescription
VALIDATION_ERROR400Request body/parameters validation failed
MISSING_FILES400No files were uploaded
MISSING_SELFIE400Selfie image is required but not provided
MISSING_ID_FRONT400ID front image is required but not provided
MISSING_ID400Verification ID parameter is required
INVALID_FILE_TYPE400Uploaded file type is not supported
FILE_TOO_LARGE400Uploaded file exceeds the size limit (10MB)

Examples

Missing Selfie:

json
{
  "success": false,
  "error": {
    "code": "MISSING_SELFIE",
    "message": "Selfie image is required"
  }
}

Invalid File Type:

json
{
  "success": false,
  "error": {
    "code": "INVALID_FILE_TYPE",
    "message": "Invalid file type. Allowed types: JPEG, PNG, WebP"
  }
}

Validation Error:

json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid profile picture URL"
  }
}

Verification Errors

CodeHTTP StatusDescription
VERIFICATION_ERROR500General verification processing error
PROFILE_PICTURE_ERROR400Failed to fetch the profile picture URL
FACE_COMPARISON_ERROR400Face comparison failed (unclear photos)
SERVICE_UNAVAILABLE503Required service (Rekognition/OCR) is unavailable
NOT_FOUND404Verification not found

Examples

Profile Picture Fetch Error:

json
{
  "success": false,
  "error": {
    "code": "PROFILE_PICTURE_ERROR",
    "message": "Failed to fetch profile picture from URL: HTTP 404"
  }
}

Face Comparison Error:

json
{
  "success": false,
  "error": {
    "code": "FACE_COMPARISON_ERROR",
    "message": "Face comparison failed. Please ensure clear photos of face."
  }
}

Service Unavailable:

json
{
  "success": false,
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Face comparison service is not available"
  }
}

Session Errors

CodeHTTP StatusDescription
SESSION_EXPIRED401Session token has expired
INVALID_SESSION401Session token is invalid or malformed

Examples

Session Expired:

json
{
  "success": false,
  "error": "Session has expired"
}

General Errors

CodeHTTP StatusDescription
NOT_FOUND404Endpoint or resource not found
INTERNAL_ERROR500Unexpected server error
AUTH_ERROR500Internal authentication error

Examples

Endpoint Not Found:

json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Endpoint not found"
  }
}

Handling Errors

Node.js Example

javascript
async function verifyWithErrorHandling(selfiePath, profileUrl) {
  try {
    const result = await client.selfieMatch(selfiePath, profileUrl);
    return result;
  } catch (error) {
    switch (error.code) {
      case 'MISSING_API_KEY':
      case 'INVALID_API_KEY':
        console.error('Authentication error - check your API key');
        break;
      
      case 'PROFILE_PICTURE_ERROR':
        console.error('Could not fetch profile picture - check the URL');
        break;
      
      case 'FACE_COMPARISON_ERROR':
        console.error('Face comparison failed - photos may be unclear');
        break;
      
      case 'SERVICE_UNAVAILABLE':
        console.error('Service temporarily unavailable - retry later');
        break;
      
      default:
        console.error('Unknown error:', error.message);
    }
    
    throw error;
  }
}

Python Example

python
from yeboverify import YeboVerifyClient, YeboVerifyError

client = YeboVerifyClient(api_key)

try:
    result = client.selfie_match(selfie_path, profile_url)
except YeboVerifyError as e:
    if e.code == 'MISSING_API_KEY' or e.code == 'INVALID_API_KEY':
        print('Authentication error - check your API key')
    elif e.code == 'PROFILE_PICTURE_ERROR':
        print('Could not fetch profile picture - check the URL')
    elif e.code == 'FACE_COMPARISON_ERROR':
        print('Face comparison failed - photos may be unclear')
    elif e.code == 'SERVICE_UNAVAILABLE':
        print('Service temporarily unavailable - retry later')
    else:
        print(f'Unknown error: {e.message}')
    
    raise

Rate Limiting

When you exceed your rate limit, you'll receive:

json
{
  "success": false,
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many requests. Please try again later."
  }
}

HTTP Status: 429 Too Many Requests

Headers:

  • X-RateLimit-Limit: Your rate limit
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Unix timestamp when the limit resets

Handling Rate Limits

javascript
async function verifyWithRetry(selfiePath, profileUrl, maxRetries = 3) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    try {
      return await client.selfieMatch(selfiePath, profileUrl);
    } catch (error) {
      if (error.code === 'RATE_LIMIT_EXCEEDED' && attempt < maxRetries - 1) {
        const waitMs = Math.pow(2, attempt) * 1000; // Exponential backoff
        console.log(`Rate limited. Waiting ${waitMs}ms...`);
        await new Promise(resolve => setTimeout(resolve, waitMs));
        continue;
      }
      throw error;
    }
  }
}