Skip to main content

Error Handling Guide

Learn how to properly handle errors from the GTMAPIs validation API.

Error Response Format

All errors return an appropriate HTTP status code with JSON body:

HTTP Status Codes

Common Errors

400 Bad Request

Cause: Invalid request format or missing required fields

Missing Email Field

Solution: Include email field in request body

Invalid Email Format

Solution: Validate email format before sending

Too Many Emails in Bulk Request

Solution: Split into batches of 100

401 Unauthorized

Cause: Missing or invalid API key

Missing API Key Header

Solution: Always include X-API-Key header

Invalid API Key

Solution: Verify API key format and validity

Revoked API Key

Solution: Generate a new API key from the dashboard

429 Too Many Requests

Cause: Rate limit exceeded (10,000 requests/minute per API key or 1,000 requests/minute per IP)
Solution: Implement retry logic with exponential backoff

500 Internal Server Error

Cause: Unexpected server error
Solution: Retry request or contact support

503 Service Unavailable

Cause: Service temporarily unavailable (maintenance or overload)
Solution: Implement circuit breaker pattern

Validation Result Errors

Even with HTTP 200, emails can have validation issues:

Invalid Email

Handling:

Risky Email

Handling:

Unknown Verification

Handling:

Error Handling Patterns

Comprehensive Error Handler

Bulk Validation Error Handling

Monitoring and Logging

Log Errors for Analysis

Track Error Rates

Next Steps

Rate Limits

Understand rate limiting strategies

API Integration

Full integration patterns