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
| Status | Error | Description |
|---|---|---|
| 200 | Success | Request processed successfully |
| 400 | Bad Request | Invalid request format or parameters |
| 401 | Unauthorized | Missing or invalid API key |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected server error |
| 503 | Service Unavailable | Service temporarily unavailable |
Common Errors
400 Bad Request
Cause: Invalid request format or missing required fieldsMissing Email Field
email field in request body
Invalid Email Format
Too Many Emails in Bulk Request
401 Unauthorized
Cause: Missing or invalid API keyMissing API Key Header
X-API-Key header
Invalid API Key
Revoked API Key
429 Too Many Requests
Cause: Rate limit exceeded (1000 requests/minute)500 Internal Server Error
Cause: Unexpected server error503 Service Unavailable
Cause: Service temporarily unavailable (maintenance or overload)Validation Result Errors
Even with HTTP 200, emails can have validation issues:Invalid Email
Risky Email
Unknown Verification
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