Error Response Format
All API errors follow a consistent JSON format to help you quickly identify and resolve issues.Standard Error Response
Always
false for error responsesA human-readable description of the error
Detailed error information
HTTP Status Codes
The Mindhunters API uses standard HTTP status codes to indicate success or failure.Success Codes (2xx)
| Status Code | Meaning | Description |
|---|---|---|
| 200 | OK | Request succeeded |
| 201 | Created | Resource successfully created |
Client Error Codes (4xx)
| Status Code | Meaning | Description |
|---|---|---|
| 400 | Bad Request | Malformed request or invalid JSON |
| 401 | Unauthorized | Missing or invalid authentication token |
| 403 | Forbidden | Valid token but insufficient permissions |
| 404 | Not Found | Resource or endpoint doesn’t exist |
| 422 | Unprocessable Entity | Validation failed on one or more fields |
| 429 | Too Many Requests | Rate limit exceeded |
Server Error Codes (5xx)
| Status Code | Meaning | Description |
|---|---|---|
| 500 | Internal Server Error | Unexpected server error occurred |
| 502 | Bad Gateway | Service temporarily unavailable |
| 503 | Service Unavailable | Server overloaded or under maintenance |
Common Errors
Authentication Errors
401 Unauthorized - Missing Token
Authorization: Bearer YOUR_API_TOKEN header in your request.
401 Unauthorized - Invalid Token
403 Forbidden - Insufficient Permissions
Validation Errors
422 Unprocessable Entity - Missing Required Field
422 Unprocessable Entity - Invalid Format
422 Unprocessable Entity - Invalid UUID
550e8400-e29b-41d4-a716-446655440000).
Resource Errors
404 Not Found - Resource
404 Not Found - Endpoint
Rate Limit Errors
429 Too Many Requests
retryAfter (seconds).
Server Errors
500 Internal Server Error
503 Service Unavailable
Error Handling Best Practices
Always check response status
Always check response status
Never assume a request succeeded. Always check the HTTP status code and handle errors appropriately.
Implement retry logic
Implement retry logic
Implement exponential backoff for transient errors (5xx, 429). Don’t retry client errors (4xx) except after fixing the issue.Retry: 429, 500, 502, 503
Don’t retry: 400, 401, 403, 404, 422
Log errors with context
Log errors with context
Log errors with request IDs, timestamps, and relevant context for debugging.
Validate before sending
Validate before sending
Validate request data on the client side before sending to reduce validation errors.
Handle errors gracefully
Handle errors gracefully
Provide user-friendly error messages instead of exposing technical details.
Monitor error rates
Monitor error rates
Track error rates and patterns in your monitoring system. Set up alerts for unusual error spikes.
Complete Error Handling Example
Here’s a comprehensive example with proper error handling:Troubleshooting Guide
Quick Diagnostics
Check authentication
Verify your API token is correct and hasn’t been revoked. Test with a simple GET request.
Review API logs
Check the Monitoring dashboard for detailed error information.
Common Issues and Solutions
| Issue | Possible Cause | Solution |
|---|---|---|
| CORS errors | Calling API from browser without proper setup | Use server-side API calls or configure CORS in dashboard |
| Timeout errors | Slow network or server overload | Implement retry logic with exponential backoff |
| Invalid JSON | Malformed request body | Validate JSON before sending, use JSON.stringify() |
| Wrong content-type | Missing or incorrect Content-Type header | Set Content-Type: application/json |
| Inconsistent errors | Network instability | Check network connection, use retry logic |
Getting Support
If you continue to experience errors after troubleshooting:Check API Logs
Review detailed logs in your dashboard
Email Support
Contact support@mindhunters.ai with request details and log IDs
Documentation
Review endpoint-specific documentation
Status Page
Check status.mindhunters.ai for ongoing incidents
Information to Include
When contacting support, please provide:- Request ID from the error response or logs
- Timestamp when the error occurred
- Endpoint you were calling
- Request payload (sanitized - remove sensitive data)
- Error response received
- Expected behavior
Next Steps
Monitoring
Learn to track and debug API issues
API Reference
Explore all available endpoints
Best Practices
Follow our quickstart guide
Webhooks
Set up event notifications
