Skip to main content

Error Response Format

All API errors follow a consistent JSON format to help you quickly identify and resolve issues.
Standard Error Response
success
boolean
Always false for error responses
message
string
A human-readable description of the error
error
object
Detailed error information

HTTP Status Codes

The Mindhunters API uses standard HTTP status codes to indicate success or failure.

Success Codes (2xx)

Client Error Codes (4xx)

Server Error Codes (5xx)

Common Errors

Authentication Errors

401 Unauthorized - Missing Token

Solution: Include the Authorization: Bearer YOUR_API_TOKEN header in your request.

401 Unauthorized - Invalid Token

Solution: Verify your API token is correct and hasn’t been revoked. Generate a new token if necessary.

403 Forbidden - Insufficient Permissions

Solution: Ensure your API token has the necessary permissions. Contact your workspace admin.

Validation Errors

422 Unprocessable Entity - Missing Required Field

Solution: Include all required fields in your request body.

422 Unprocessable Entity - Invalid Format

Solution: Ensure phone numbers are in E.164 format (+[country code][number]).

422 Unprocessable Entity - Invalid UUID

Solution: Ensure UUIDs are in the correct format (e.g., 550e8400-e29b-41d4-a716-446655440000).

Resource Errors

404 Not Found - Resource

Solution: Verify the resource ID is correct and the resource exists in your workspace.

404 Not Found - Endpoint

Solution: Check the endpoint URL and HTTP method. Verify you’re using the correct API version.

Rate Limit Errors

429 Too Many Requests

Solution: Implement exponential backoff and retry logic. Wait for the time specified in retryAfter (seconds).

Server Errors

500 Internal Server Error

Solution: This is a temporary server error. Retry the request. If the error persists, contact support@mindhunters.ai with the request details.

503 Service Unavailable

Solution: Wait a few minutes and retry. Check the Mindhunters status page for ongoing incidents.

Error Handling Best Practices

Never assume a request succeeded. Always check the HTTP status code and handle errors appropriately.
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 request IDs, timestamps, and relevant context for debugging.
Validate request data on the client side before sending to reduce validation errors.
Provide user-friendly error messages instead of exposing technical details.
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

1

Check authentication

Verify your API token is correct and hasn’t been revoked. Test with a simple GET request.
2

Validate request format

Ensure your request body is valid JSON and includes all required fields.
3

Check tenant/subdomain

Verify you’re using the correct tenant in your base URL.
4

Review API logs

Check the Monitoring dashboard for detailed error information.
5

Test with cURL

Isolate the issue by testing with a simple cURL command.

Common Issues and Solutions

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