How does throttling work?

Throttling depends on the authentication method you are using:

OAuth2

Each key/secret pair has the following limitations across all Keap applications they are used to access:

  • 1500 Queries per Minute
  • 150000 Queries per Day (This daily quota resets at 12:00 AM UTC each day)

We return Headers on every call you make to keep you up-to-date on exactly where your quota and throttles stand. You can find details and code examples for making us of the information at API Token Quota and Usage Measurements.

Personal Access Tokens or Service Account Keys

Each key has the following limitations and may only access it’s single authorized Keap application:

  • 10 Queries per Second
  • 240 Queries per Minute
  • 30000 Queries per Day (This daily quota resets at 12:00 AM UTC each day)

We return Headers on every call you make to keep you up-to-date on exactly where your quota and throttles stand. You can find details and code examples for making us of the information at API Token Quota and Usage Measurements.

Legacy API Key

Each key has the following limitations and may only access it’s single authorized Keap application:

  • A theoretical maximum of 160000 Queries per Day

Details:

The throttling system is setup like a bank account. You have so many dollars (will be called tokens) in that account you can use. Every Keap Application has a bank of 10,000 tokens. For every API call that is made, 1 token gets removed from that bank. However, for every 500ms that there is not an API call, you get one token back in the bank, up to the max of 10,000 tokens.

When you run out of tokens, your API call gets delayed 500ms until you get a new token. For instance, you are out of tokens and you have 4 API calls come in at the same time. The first one will be delayed 500ms, the next one 1 second then 1.5 seconds and finally 2 seconds.

Once you hit 4 threads being throttled, you will then start to receive an error stating you have been throttled. The only way to become un-throttled is to cease all API calls. It takes approximately 1.5 hours of no API calls to regenerate all 10,000 tokens. You will receive the following error:

Server returned a fault exception: [500] Server encountered exception: com.infusionsoft.throttle.ThrottlingException: Maximum number of threads throttled

Posted in: API