Have you wondered why your ‘API requests last 24h’ stat on the Salesforce does not go down/does not reset after 24 hours? After digging through the Salesforce Community and lots of blogs, I had an assumption but wanted to find confirmation. Eventually, the Salesforce Support team confirmed:

API Usage

 

The 24 hours limit is a sliding window/rolling period.

You can take it quite literally as exactly “the last 24 hours”.

What does that mean?

The API limit applies to the most recent 24 hours period.

Let’s assume your limit is 10,000 API calls. For simplicity sake let’s also assume you have 2,000 API requests at 2am, 7,000 at 5pm and 2,000 at 1am the next day.

Scenario 1

You won’t have exceeded the limit at 5pm (Scenario 1) as that is only a total of 9,000 API calls, but you will have exceeded it at 1am (Scenario 2) the next day for one hour until 2am (when you will have 1,000 available again – Scenario 3).

Scenario 2

This is because the API limit does not reset at midnight (which most Salesforce users assume), but it counts in rolling 24 hour periods.

Our first big API hit was at 2am of 2,000 calls which started our window, which means that between 2am and tomorrow’s 2am you can have up to 10,000 calls. As we exceed that with additional 2,000 on the next day at 1am, the limit is exceeded for one hour until the 24 hours window slides past 2am (Scenario 3) and the total API calls in the past 24 hour period are only 9,000 (7,000 from 5pm and 2,000 from 1am the next day – Note: 2am the first day does not fall into this window any more as it is past 2am).

Scenario 3

Advertisements