Skip to main content

Error Response Format

All Sixtyfour API errors return a JSON response with a consistent structure:
{
  "error": "Error Type",
  "message": "Detailed error message"
}
Some endpoints may use an alternative format:
{
  "detail": "Error description"
}

HTTP Status Codes

The API uses standard HTTP status codes to indicate success or failure.
Status CodeMeaningDescription
200OKRequest succeeded
400Bad RequestInvalid request body, missing required fields, or malformed data
401UnauthorizedMissing or invalid API key
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error - retry after a brief wait

Common Error Types

400 Bad Request

Causes:
  • Missing required fields in request body
  • Invalid field types or formats
  • Malformed JSON payload
  • Empty or invalid lead/company data
Examples:
{
  "error": "Bad Request",
  "message": "Invalid company data"
}
{
  "detail": "Lead data is required"
}
{
  "error": "Bad Request",
  "message": "Missing required field: qualification_criteria"
}
How to fix:
  • Verify all required fields are included in your request
  • Check that field types match the API specification
  • Ensure JSON is properly formatted
  • Validate input data before making the request

401 Unauthorized

Causes:
  • Missing x-api-key header
  • Invalid or expired API key
  • API key not properly formatted
Example:
{
  "error": "Unauthorized",
  "message": "Invalid API key"
}
How to fix:
  • Verify your API key is correct
  • Ensure the x-api-key header is included in every request
  • Check that your API key hasn’t been revoked or expired
  • Get a new API key from the dashboard

429 Rate Limit Exceeded

Causes:
  • Exceeded the rate limit of 500 requests per minute
Example:
{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded"
}
How to fix:
  • Implement exponential backoff and retry logic
  • Wait 60 seconds before retrying
  • Spread requests over time to stay under the limit
  • Use async endpoints for bulk operations
  • Contact support if you need a higher rate limit

500 Internal Server Error

Causes:
  • Temporary server issue
  • Unexpected error during processing
  • Service degradation
Example:
{
  "error": "Internal Server Error",
  "message": "An unexpected error occurred"
}
How to fix:
  • Wait a few seconds and retry the request
  • Implement retry logic with exponential backoff
  • If the error persists, contact support at [email protected]

Rate Limits

The Sixtyfour API enforces the following rate limits:
  • 500 requests per minute per API key
Rate limit information may be included in response headers (if available):
  • X-RateLimit-Limit: Maximum requests allowed per minute
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Unix timestamp when the limit resets

Best Practices for Rate Limiting

  1. Implement Retry Logic
import requests
import time

def make_request_with_retry(url, headers, data, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = requests.post(url, headers=headers, json=data)

            if response.status_code == 429:
                wait_time = 2 ** attempt  # Exponential backoff
                print(f"Rate limit exceeded. Waiting {wait_time} seconds...")
                time.sleep(wait_time)
                continue

            response.raise_for_status()
            return response.json()

        except requests.exceptions.RequestException as e:
            if attempt == max_retries - 1:
                raise
            time.sleep(2 ** attempt)

    raise Exception("Max retries exceeded")
  1. Use Async Endpoints for Bulk Operations
For processing multiple items, use async endpoints (/enrich-company-async, /enrich-lead-async) instead of making many synchronous calls.
  1. Implement Request Queuing
Queue requests and process them at a controlled rate to stay under the limit.

Timeout Issues

Long-Running Requests

Some endpoints perform deep research and can take several minutes:
  • Enrich Lead: P95 runtime ~5 minutes, up to 10 minutes
  • Enrich Company: Several minutes depending on research depth
  • QA Agent: Varies based on criteria complexity
Solutions:
  1. Set Appropriate Timeouts
import requests

# For sync endpoints, set timeout to at least 15 minutes (900 seconds)
response = requests.post(
    "https://api.sixtyfour.ai/enrich-lead",
    headers=headers,
    json=data,
    timeout=900  # 15 minutes
)
response.raise_for_status()
  1. Use Async Endpoints
import requests
import time

# Start async job
response = requests.post(
    "https://api.sixtyfour.ai/enrich-lead-async",
    headers=headers,
    json=data
)
response.raise_for_status()
task_id = response.json()["task_id"]

# Poll for results
while True:
    status_response = requests.get(
        f"https://api.sixtyfour.ai/job-status/{task_id}",
        headers=headers
    )
    status_response.raise_for_status()
    status = status_response.json()

    if status["status"] == "completed":
        results = status["result"]
        break
    elif status["status"] == "failed":
        print(f"Job failed: {status.get('error')}")
        break

    time.sleep(10)
  1. Use Webhooks
Configure webhooks to receive notifications when async jobs complete. See Webhooks documentation.

Common Troubleshooting Scenarios

Issue: “Invalid API key” error

Check:
  • Is the x-api-key header included?
  • Is the API key copied correctly (no extra spaces)?
  • Has the API key been revoked or expired?
Solution: Get your API key from the dashboard and verify it’s correctly included in the header.

Issue: Request times out

Check:
  • Are you using a sync endpoint for long-running operations?
  • Is your HTTP client timeout set appropriately?
Solution: Use async endpoints or increase client timeout to at least 15 minutes (900 seconds).

Issue: Empty or incomplete results

Check:
  • Did you provide enough input data for the enrichment?
  • Is the struct field properly defined with clear descriptions?
  • Are you requesting data that may not be publicly available?
Solution:
  • Provide as much input data as possible (name, company, LinkedIn, etc.)
  • Write clear, detailed descriptions in the struct field
  • Check the confidence_score in the response to gauge data quality

Issue: Rate limit exceeded frequently

Check:
  • Are you making more than 500 requests per minute?
  • Are you implementing retry logic properly?
Solution:
  • Use async endpoints for bulk operations
  • Implement request queuing to control the rate
  • Add delays between requests
  • Contact support if you need a higher limit

Issue: “Bad Request” with valid data

Check:
  • Is the JSON properly formatted?
  • Are all required fields included?
  • Are field types correct (object vs string, etc.)?
Solution: Validate your JSON payload and compare against the endpoint documentation.

Getting Help

If you’re experiencing issues not covered in this guide:
  1. Check the API Reference for endpoint-specific requirements
  2. Review the starter notebooks for working examples
  3. Contact support at [email protected]
  4. Include the following in your support request:
    • Request/response details (remove sensitive data)
    • Error message
    • Endpoint being called
    • Approximate timestamp of the error