ErzyCall API
    ErzyCall API

    Getting Started

    Quick StartAuthentication

    Guides

    Rate LimitingError HandlingWebhooks

    API Reference

    CallsContactsCasesAssistantsPhone NumbersContact GroupsWebhook EndpointsWhatsApp

    Rate Limiting

    Understand the ErzyCall API rate limits and how to handle 429 responses.

    The ErzyCall REST API enforces rate limits per API key using a sliding window algorithm.

    Limits

    WindowLimit
    Per minute60 requests
    Per hour1,000 requests

    Both windows are evaluated independently. If either limit is exceeded, the request is rejected with a 429 status.

    Rate Limit Headers

    Every response includes rate limit headers so you can track your usage:

    HeaderDescription
    X-RateLimit-LimitMaximum requests allowed in the current window
    X-RateLimit-RemainingRequests remaining in the current window
    X-RateLimit-ResetUnix timestamp (seconds) when the window resets

    When rate limited, an additional header is included:

    HeaderDescription
    Retry-AfterSeconds to wait before retrying

    429 Response

    {
      "error": {
        "code": "RATE_LIMITED",
        "message": "Rate limit exceeded. Retry after 12s"
      }
    }

    Handling Rate Limits

    Exponential Backoff

    The simplest approach is to respect the Retry-After header:

    async function apiCall(url, options) {
      const response = await fetch(url, options);
    
      if (response.status === 429) {
        const retryAfter = parseInt(response.headers.get("Retry-After") || "5");
        await new Promise((r) => setTimeout(r, retryAfter * 1000));
        return apiCall(url, options); // Retry
      }
    
      return response;
    }

    Proactive Throttling

    Monitor the X-RateLimit-Remaining header and slow down as you approach the limit:

    async function apiCall(url, options) {
      const response = await fetch(url, options);
      const remaining = parseInt(response.headers.get("X-RateLimit-Remaining") || "60");
    
      if (remaining < 5) {
        // Approaching limit — add a delay before next request
        await new Promise((r) => setTimeout(r, 2000));
      }
    
      return response;
    }

    Tips

    • Batch operations when possible instead of making many individual requests.
    • Cache responses for data that doesn't change frequently (e.g., phone numbers, assistants).
    • Use webhooks instead of polling for real-time updates.
    • Distribute load across multiple API keys if you need higher throughput.

    Authentication

    How to authenticate with the ErzyCall REST API using API keys.

    Error Handling

    Understand the error response format and common error codes.

    On this page

    LimitsRate Limit Headers429 ResponseHandling Rate LimitsExponential BackoffProactive ThrottlingTips