Salesly API

Rate Limits

Understand API rate limits and how to handle 429 responses.

The Salesly API enforces rate limits to ensure fair usage and system stability.

Limits

Endpoint TypeLimitScope
Read (GET)120 requests/minutePer API key
Write (POST, PUT, DELETE)30 requests/minutePer API key

Rate Limit Headers

When you exceed the limit, the API returns a 429 Too Many Requests response with a Retry-After header:

429 Too Many Requests
{
  "error": {
    "type": "rate_limit_exceeded",
    "message": "Too many requests. Please retry after the period indicated in the Retry-After header."
  }
}
Response header
Retry-After: 42

The Retry-After value is the number of seconds to wait before retrying.

Handling Rate Limits

JavaScript — exponential backoff
async function apiCallWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    const response = await fetch(url, options);

    if (response.status !== 429) {
      return response;
    }

    const retryAfter = parseInt(response.headers.get("Retry-After") || "60");
    const delay = retryAfter * 1000;

    console.log(`Rate limited. Retrying in ${retryAfter}s...`);
    await new Promise((resolve) => setTimeout(resolve, delay));
  }

  throw new Error("Max retries exceeded");
}

Best Practices

  • Batch operations — use /batch endpoints instead of looping single creates
  • Cache responses — avoid re-fetching data that hasn't changed
  • Spread requests — distribute writes over time instead of bursting
  • Monitor 429s — track rate limit responses in your application logs
  • Use Retry-After — always respect the header value rather than guessing