Skip to content

Error Codes

All errors follow a consistent JSON structure:

{
"error": {
"code": "ERROR_CODE",
"message": "Human-readable description",
"details": {}
},
"timestamp": "2024-01-15T10:30:00.000Z"
}

No API key provided in the request.

{
"error": {
"code": "MISSING_API_KEY",
"message": "API key is required. Provide via X-API-Key header, Authorization: Bearer token, or api_key query parameter."
}
}

The provided API key is malformed or doesn’t exist.

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

Resolution: Verify your API key starts with spm_live_ or spm_test_ and is 32+ characters.

The API key exists but has been disabled.

{
"error": {
"code": "API_KEY_DISABLED",
"message": "This API key has been disabled"
}
}

The API key has passed its expiration date.

{
"error": {
"code": "API_KEY_EXPIRED",
"message": "This API key has expired",
"details": {
"expiredAt": "2024-01-01T00:00:00.000Z"
}
}
}

The API key doesn’t have permission for this operation.

{
"error": {
"code": "INSUFFICIENT_SCOPE",
"message": "API key lacks required scope: validate:write",
"details": {
"requiredScope": "validate:write",
"availableScopes": ["validate:read"]
}
}
}

Request came from an IP address not in the key’s allowlist.

{
"error": {
"code": "IP_NOT_ALLOWED",
"message": "Request IP not in allowed list",
"details": {
"requestIp": "192.168.1.1"
}
}
}

The requested feature isn’t available on your plan.

{
"error": {
"code": "FEATURE_NOT_AVAILABLE",
"message": "SMTP verification is not available on the Growth tier",
"details": {
"feature": "smtpVerification",
"currentTier": "growth",
"requiredTier": "business"
}
}
}
{
"error": {
"code": "MISSING_EMAIL",
"message": "Email parameter is required"
}
}
{
"error": {
"code": "INVALID_EMAIL",
"message": "Email must be a non-empty string"
}
}
{
"error": {
"code": "BATCH_TOO_LARGE",
"message": "Batch size exceeds maximum of 100 emails",
"details": {
"submitted": 150,
"maximum": 100
}
}
}
{
"error": {
"code": "BATCH_EMPTY",
"message": "At least one email is required for batch validation"
}
}

Too many requests in the current time window.

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. 100 requests per minute allowed.",
"details": {
"limit": 100,
"window": "minute",
"retryAfter": 45
}
}
}
{
"error": {
"code": "DAILY_LIMIT_EXCEEDED",
"message": "Daily limit of 10,000 requests exceeded",
"details": {
"limit": 10000,
"used": 10000,
"resetsAt": "2024-01-16T00:00:00.000Z"
}
}
}

Monthly quota exhausted (Free/Hobby tiers stop at 100%).

{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Monthly quota exceeded. Upgrade your plan for more validations.",
"details": {
"limit": 100,
"used": 100,
"percentage": 100,
"tier": "free"
}
}
}

Exceeded the 120% grace period (Growth+ tiers).

{
"error": {
"code": "GRACE_PERIOD_EXCEEDED",
"message": "Exceeded 120% grace period. Hard stop until next billing cycle.",
"details": {
"limit": 10000,
"used": 12001,
"percentage": 120.01,
"hardLimit": 12000,
"resetsAt": "2024-02-01T00:00:00.000Z"
}
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}
{
"error": {
"code": "VALIDATION_TIMEOUT",
"message": "Validation timed out after 30 seconds"
}
}

Resolution: Try quickMode: true to skip slow checks.

The official SDK provides typed error classes:

import {
Spamidate,
AuthenticationError,
RateLimitError,
QuotaExceededError,
ValidationInputError,
NetworkError,
TimeoutError,
} from '@spamidate/sdk';
try {
const result = await client.validate('user@example.com');
} catch (error) {
if (error instanceof RateLimitError) {
// Wait and retry
await sleep(error.retryAfter * 1000);
return client.validate(email);
}
if (error instanceof QuotaExceededError) {
notifyAdmin('Quota exceeded - upgrade needed');
}
if (error instanceof AuthenticationError) {
console.error('Check API key configuration');
}
}
Error CodeRetryableAction
RATE_LIMIT_EXCEEDEDYesWait for Retry-After
VALIDATION_TIMEOUTYesRetry with quickMode: true
INTERNAL_ERRORYesExponential backoff
INVALID_API_KEYNoFix API key
QUOTA_EXCEEDEDNoUpgrade plan