SalesOS

Rate Limiting

SalesOS API rate limits and how to handle them.

The full guide is in Developers → Rate limits.

Limits

ScopeLimit
Per API keyThe key's own quota, set when you create it (default 1,000 requests per hour)
Per OAuth appThe app's quota, per organization that installed it
Per client IP20 requests per second, 200 per minute, 2,000 per hour; sign-in, password reset and similar routes are tighter

Response headers

Requests made with an API key or OAuth token carry:

RateLimit-Limit: 1000
RateLimit-Remaining: 997
RateLimit-Reset: 2712
RateLimit-Policy: 1000;w=3600
HeaderDescription
RateLimit-LimitRequests allowed in the window
RateLimit-RemainingRequests left in the window
RateLimit-ResetSeconds until the window resets
RateLimit-PolicyThe quota and the window length in seconds (w)

Rate limit exceeded

The API answers 429 with a Retry-After header (in seconds) and a code such as API_KEY_RATE_LIMITED or OAUTH_RATE_LIMITED.

async function fetchWithRetry(url, options, maxRetries = 3) {
  for (let attempt = 0; ; attempt++) {
    const res = await fetch(url, options);
    if (res.status !== 429 || attempt === maxRetries) return res;
    const retryAfter = Number(res.headers.get('Retry-After'));
    const delay = retryAfter ? retryAfter * 1000 : 2 ** attempt * 1000 * (0.5 + Math.random());
    await new Promise((r) => setTimeout(r, delay));
  }
}

Best practices

  • Pace jobs with RateLimit-Remaining instead of running into the limit.
  • Use the Bulk API for large loads and exports.
  • Use webhooks instead of polling for changes.
  • Retry writes only with an Idempotency-Key.

On this page