Error Handling
Understanding and handling API errors effectively
HTTP Status Codes
| Status Code | Meaning | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Missing required fields, invalid key, file too large |
| 405 | Method Not Allowed | Using GET instead of POST |
| 429 | Too Many Requests | Rate limit exceeded (wait 3 seconds) |
| 500 | Internal Server Error | Email sending failed, database error |
Error Response Format
All error responses follow this structure:
Common Errors
Missing Required Fields (400)
Invalid Verification Key (400)
Domain Mismatch (400)
Too Many Files (400)
File Too Large (400)
Rate Limit Exceeded (429)
Handling Errors in Code
JavaScript Example
Python Example
Best Practices
Error Handling Tips
-
Always check the
successfield in responses - Display field-specific errors near the input fields
- Show general errors in a prominent location
- Implement retry logic for network errors
- Handle rate limiting with appropriate delays
- Validate input client-side before submitting
- Provide user-friendly error messages