# How are organization API rate limits calculated, and what happens when integration volume exceeds thresholds?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, API Limits, Governor Limits

Read it on the site: https://www.forcechallenges.com/interview-questions/how-are-organization-api-rate-limits-calculated-and-what-happens-when-integration-volume-exceeds-thresholds

## Answer

**Basics:** Salesforce meters calls from external systems (REST, SOAP, Bulk, Connect REST) so one org cannot hurt others. The allocation is roughly: a base per edition plus a per-license amount. Typical published figures: Developer Edition 15,000 per 24 hours; Enterprise base of 100,000 plus 1,000 per Salesforce user license; Unlimited and Performance 5,000 per license (verify current numbers in the Limits documentation, since add-ons and platform licenses vary). Sandboxes have a much larger allowance (commonly cited as 5 million).

**How it works:**
1. Each API request adds to a rolling 24-hour count (not a calendar-day reset).
2. When the count passes the entitlement, new calls fail with `REQUEST_LIMIT_EXCEEDED`.
3. The count also protects concurrency: in production, 25 long-running requests (20 seconds or more) at the same time is the ceiling.
4. Monitor through Setup, System Overview; the `/limits` REST resource (`DailyApiRequests` Max and Remaining); the `Sforce-Limit-Info: api-usage=x/y` response header; and Event Monitoring.

**Advanced / deep dive:** Not everything counts: Apex running inside Salesforce, UI actions and Salesforce-initiated callouts do not use API requests. Bulk API and Bulk API 2.0 count batches or jobs rather than rows and also have separate daily batch limits, so loading millions of rows via Bulk is far cheaper than record-by-record REST. Strategies for staying under the cap: Composite and sObject Collections to merge calls; queries that fetch many rows per call (up to 2,000 per page); CDC or platform events instead of polling; caching reference data; Salesforce Connect for read-only virtualization; per-integration throttling and queuing in middleware; and alerts at 70 to 80 percent. If you really need more, buy API call add-ons. Identify top consumers by integration user using Event Monitoring `ApiEvent` or the "API Usage Notifications" feature.

**Code / config example:**
```bash
curl -H "Authorization: Bearer $TOKEN" "$INSTANCE/services/data/v62.0/limits" \
 | jq '.DailyApiRequests'
# {"Max":115000,"Remaining":98342}
```

**Hidden gotchas & must-remember points:**
- It is a rolling window, so recovery is gradual.
- Polling is the biggest hidden consumer; replace it with events.
- Failed calls and login calls can still count.
- Professional Edition has no API access unless purchased.
- Create "API Usage Notifications" in Setup so admins are alerted before the cap.

**Best practice:** Treat the API allocation as a budget: measure per integration, batch aggressively and prefer event-driven designs over polling.

---
Source: ForceChallenges · last updated 2026-11-02
