Throttling

Throttling

You may not perform more than 20 requests per second across all of your organization's API keys.

To stay within this limit, we strongly recommend that you use a library to help you orchestrate your request rate. It can be very helpful for the rate limiting framework of your choice to be backed by a system like Redis, that way you can ensure that you are staying below the limit across all of your apps that issue requests into Onfleet. You should also favor sequential over parallel requests if you don't want to implement a sophisticated rate limiting system.

If you exceed 20 req/s, you will first receive a 429 error. Failure to slow down your request rate may result in a temporary ban. The headers X-RateLimit-Limit and X-RateLimit-Remaining are available to help you understand how many requests are available for a given rolling window period and how many are instantaneously remaining for you to make.

Few guidelines on how to avoid making too many requests:

  • If possible, use webhooks instead of polling for state changes
  • When creating many tasks, use the batch endpoint if possible
  • If it seems like you’re making many requests for a simple operation or finding many entities to locally scan for a single one, it’s possible you’re using the API in an inefficient way.

Should you require a higher request rate, do let us know by contacting support and we will do everything we can to accommodate your needs. The more details you can share about your existing efforts to stay below the global limit, the better we will be able to understand your situation and provide assistance.