Onboarder

API Documentation

Error Codes

Complete reference of all error codes returned by the Onboarder API.

Error Response Format

All error responses follow a standardized format with detailed information about what went wrong.

{
"success": false,
"statusCode": 400,
"error": {
"code": "VERIFICATION_FAILED",
"message": "NIN verification failed",
"details": "The provided NIN does not match records",
"fields": [
{
"field": "idNumber",
"message": "Invalid NIN format"
}
]
},
"metadata": {
"requestId": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2025-11-02T10:30:00.000Z",
"version": "v1"
},
"docsUrl": "https://docs.unboarder.com/errors/verification_failed"
}

Authentication & Authorization

Error CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid authentication credentials
INVALID_CREDENTIALS401Email or password is incorrect
TOKEN_EXPIRED401Access token has expired, use refresh token
TOKEN_INVALID401Token is malformed or invalid
REFRESH_TOKEN_INVALID401Refresh token is invalid or expired
FORBIDDEN403You don't have permission to access this resource
INSUFFICIENT_PERMISSIONS403Your role doesn't have required permissions

KYC Verification Errors

Error CodeHTTP StatusDescription
VERIFICATION_FAILED400Verification could not be completed
INVALID_NIN400NIN format is invalid or not found
INVALID_BVN400BVN format is invalid or not found
VERIFICATION_DATA_MISMATCH400Provided data doesn't match official records
DOCUMENT_EXPIRED400Document has expired
LIVENESS_CHECK_FAILED400Liveness detection failed - photo may not be live
FACE_MATCH_FAILED400Selfie doesn't match ID photo
UNSUPPORTED_VERIFICATION_TYPE400Verification type is not supported
INVALID_ID_NUMBER400ID number format is invalid
INVALID_PASSPORT_NUMBER400Passport number format is invalid
INVALID_DRIVERS_LICENSE400Driver's license format is invalid
DOCUMENT_INVALID400Document is invalid or cannot be verified
LOW_CONFIDENCE_SCORE400Verification confidence score is too low
UNSUPPORTED_COUNTRY400Country is not supported for this verification type

Rate Limiting

Error CodeHTTP StatusDescription
RATE_LIMIT_EXCEEDED429Too many requests, rate limit exceeded
VERIFICATION_ATTEMPT_LIMIT_EXCEEDED429Maximum verification attempts for this type exceeded
DAILY_LIMIT_EXCEEDED429Daily request limit exceeded

Billing & Payments

Error CodeHTTP StatusDescription
INSUFFICIENT_BALANCE402Account balance is insufficient
PAYMENT_REQUIRED402Payment is required to continue
WALLET_LOCKED403Wallet is locked due to suspicious activity

Server Errors

Error CodeHTTP StatusDescription
INTERNAL_SERVER_ERROR500An unexpected error occurred
SERVICE_UNAVAILABLE503Service is temporarily unavailable
PROVIDER_UNAVAILABLE503KYC provider is currently unavailable
PROVIDER_TIMEOUT504Request to KYC provider timed out
PROVIDER_ERROR502External provider returned an error
PROVIDER_RATE_LIMIT429External provider rate limit exceeded
DOJAH_ERROR502Dojah KYC provider returned an error
DATABASE_ERROR500Database operation failed
EXTERNAL_SERVICE_ERROR502External service error occurred

Handling Errors

Best practices for handling API errors:

  • Always check the success field in responses
  • Use the error.code to programmatically handle specific errors
  • Display error.message to users for human-readable errors
  • Log metadata.requestId for debugging and support requests
  • Implement exponential backoff for rate limit errors (429)
  • Retry failed requests with server errors (500, 503, 504) up to 3 times
  • For validation errors, check the error.fields array for field-specific errors