API Rate Limits

Understanding and managing API request limits for optimal performance

Overview

To ensure fair usage and maintain service quality, CX Tools implements rate limiting on API requests. Rate limits vary by endpoint and subscription tier.

Rate Limit Headers

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

These headers are included in every API response to help you track your usage and adapt your request frequency accordingly.

Rate Limits by Plan

Plan Requests/Min Daily Limit Burst Limit
Free 60 1,000 100
Pro 300 10,000 500
Enterprise Custom Custom Custom

Handling Rate Limits

Rate Limit Response

When you exceed the rate limit, our API will return a 429 status code with details about when you can retry:

HTTP/1.1 429 Too Many Requests
{
    "error": "Rate limit exceeded",
    "reset_at": "2024-01-22T10:00:00Z"
}

Best Practices

  • Implement exponential backoff for retries
  • Cache responses when possible
  • Monitor rate limit headers in responses
  • Batch requests when appropriate
  • Distribute requests evenly over time
  • Use webhooks for asynchronous operations
  • Implement proper error handling
  • Consider upgrading for higher limits

Example Implementation

async function makeRequest() {
  try {
    const response = await fetch('/api/endpoint', {
      headers: { 'Authorization': 'Bearer API_KEY' }
    });
    
    // Check remaining rate limit
    const remaining = response.headers.get('X-RateLimit-Remaining');
    if (remaining < 10) {
      // Consider implementing backoff
    }
    
    return await response.json();
  } catch (error) {
    if (error.status === 429) {
      // Handle rate limit
      const resetTime = error.headers.get('X-RateLimit-Reset');
      await sleep(calculateBackoff(resetTime));
      return makeRequest();
    }
    throw error;
  }
}

Endpoint-Specific Limits

Some endpoints have their own specific rate limits in addition to the global limits above:

Endpoint Free Plan Pro Plan
/api/calendar/status 300/day 5,000/day
/api/grxml/validate 100/day 2,000/day
/api/studio/backup 50/day 1,000/day

Next Steps

Now that you understand our rate limits, explore the available API endpoints or upgrade your plan for higher limits.