Error Codes
Complete reference of all error codes returned by the nofakemails API and how to handle them.
Error Response Format
All error responses follow a consistent JSON structure:
{
"status": 400,
"error": "Human-readable error message",
"code": "ERROR_CODE"
}HTTP Status Codes
Bad Request
The request was malformed or contains invalid parameters. Check your request body and parameters.
MISSING_EMAILThe email parameter is required but was not provided or is empty.
Why this happens: You called the /v1/email/{email} endpoint without providing an email address in the URL path, or the email parameter was empty.
{
"status": 400,
"error": "Email address is required",
"code": "MISSING_EMAIL"
}INVALID_EMAIL_FORMATThe provided email address does not conform to RFC 5322 email format.
Why this happens: The email address you provided has invalid syntax. Common issues include missing @ symbol, invalid characters, missing domain, or malformed local part.
{
"status": 400,
"error": "The email address is invalid.",
"code": "INVALID_EMAIL_FORMAT"
}EMPTY_BATCHThe batch validation request contains no email addresses.
Why this happens: You called the batch endpoint /v1/emails with an empty emails array or the field was missing entirely from the request body.
{
"success": false,
"error": {
"code": "EMPTY_BATCH",
"message": "Batch must contain at least one email address"
}
}BATCH_SIZE_EXCEEDEDThe batch contains more emails than the maximum allowed limit.
Why this happens: You attempted to validate more than 64 unique email addresses in a single batch request. Split your emails into multiple batches of 64 or fewer. Enterprise clients can request higher limits.
{
"success": false,
"error": {
"code": "BATCH_SIZE_EXCEEDED",
"message": "Batch size 100 exceeds maximum allowed (64)",
"max_allowed": 64,
"received": 100
}
}Unauthorized
Authentication failed. Your API key is missing, invalid, or has been revoked. See Authentication for how to properly configure your API key.
INVALID_API_KEYThe provided API key is invalid, expired, or has been revoked.
Why this happens:
- The
X-API-Keyheader orAuthorization: Bearertoken is missing - The API key was copied incorrectly (check for extra spaces or missing characters)
- The API key was deleted from your dashboard
- The API key belongs to a different environment (test vs. production)
- Your account has been suspended
{
"status": 401,
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}Payment Required
You don't have sufficient usage quota to complete this request.
INSUFFICIENT_USAGEYour account doesn't have enough remaining usage points for this batch validation.
Why this happens:
- You've exhausted your monthly quota (Freemium tier: 1,000/month)
- The batch request requires more points than you have remaining
- Your billing period hasn't reset yet
Solution: Upgrade to Pro tier for 200,000 validations/month with overage support, or wait for your billing period to reset.
{
"success": false,
"error": {
"code": "INSUFFICIENT_USAGE",
"message": "Insufficient usage points for batch validation",
"required": 50,
"remaining": 10
}
}Too Many Requests
You've exceeded the rate limit for your subscription tier. See Rate Limits for tier-specific limits and the token bucket algorithm.
Rate limiting is enforced per account using a token bucket algorithm.
Why this happens:
- Freemium tier: More than 1 request per second
- Pro tier: More than 5 requests per second
- Multiple API keys under the same account share the same rate limit
Solution: Check the Retry-After header for when to retry. Implement exponential backoff in your code. Upgrade to a higher tier for increased limits.
{
"status": 429,
"title": "Too Many Requests",
"detail": "You have exceeded the rate limit. Please try again in 1 seconds."
}Internal Server Error
An unexpected error occurred on the server while processing your request.
INTERNAL_ERRORSomething went wrong on our end.
Why this happens: This is typically a temporary issue with our infrastructure. It could be caused by DNS lookup failures, database connectivity issues, or other internal problems.
Solution: Retry the request with exponential backoff. If the error persists for more than a few minutes, please contact support.
{
"status": 500,
"error": "An error occurred while validating the email",
"code": "INTERNAL_ERROR"
}Service Unavailable
The service is temporarily unavailable or the request was cancelled.
REQUEST_CANCELLEDThe request was cancelled before it could complete.
Why this happens:
- The client disconnected before the response was sent
- The request timed out during processing
- The service is undergoing maintenance
- A dependent service (like DNS) is temporarily unavailable
Solution: Retry the request after a short delay. This is usually a transient issue.
{
"status": 503,
"error": "Request was cancelled",
"code": "REQUEST_CANCELLED"
}Error Codes Summary
| Code | Status | Endpoint | Description |
|---|---|---|---|
MISSING_EMAIL | 400 | Single | Email parameter is missing |
INVALID_EMAIL_FORMAT | 400 | Single | Email format is invalid |
EMPTY_BATCH | 400 | Batch | Emails array is empty |
BATCH_SIZE_EXCEEDED | 400 | Batch | More than 64 unique emails |
INVALID_API_KEY | 401 | All | API key is invalid or missing |
INSUFFICIENT_USAGE | 402 | Batch | Not enough usage points |
INTERNAL_ERROR | 500 | All | Unexpected server error |
REQUEST_CANCELLED | 503 | All | Request was cancelled or timed out |
Handling Errors
Here's a recommended approach for handling API errors in your application:
Retry Strategy
- 4xx errors (except 429): Do not retry. Fix the request parameters.
- 429 errors: Retry after the
Retry-Afterheader duration. - 5xx errors: Retry with exponential backoff (1s, 2s, 4s, max 3 retries).