Skip to main content
Skip to Content
Dispatch API

On Rate-Limiting

All the endpoints in the Spoke Public API are rate-limited, which means we will reject requests that come in too fast.

To know if your request was rate-limited, check if the response has the HTTP status code 429.

Each endpoint has a different rate limit, and Spoke can change this rate limit at any moment.

The rate limits are as follows:

  • Rate Limits for Write Endpoints: All write endpoints have a limit of 5 requests per second, which includes Creation (POST), Update (PATCH), and Deletion (DELETE) operations for all models.
    • An exception to this rule is the Driver Creation endpoint, which is limited to 1 request per second. Thus, we recommend using the Batch Import Drivers when adding multiple drivers.
  • Rate Limits for Read Endpoints: All read endpoints, including list endpoints, are limited to 10 requests per second.
  • Rate Limits for Batch Import:
    • The Batch Import endpoints for Stops and Unassigned Stops models are limited to 100 requests per 10 minutes (with a maximum rate of 30 per minute). However, these endpoints can handle the import of up to 1,000 stops per minute. The Creation, Update, and Deletion endpoints for these models still maintain a rate limit of 5 requests per second.
    • The Batch Import endpoint for Drivers is limited to 2 requests per minute. This allows for the import of up to 100 drivers per minute.
  • Rate Limits for Optimization Endpoints: The Plan optimization and re-optimization endpoints are limited to 100 requests per 10 minutes (with a maximum rate of 30 per minute), due to the long running nature of these operations.

Spoke API will occasionally support bursts of requests, but they cannot be sustained and will be rejected if they last too long.

If Spoke rejects your request because it exceeds the rate limit, you must wait before retrying it. We suggest you use an exponential backoff approach for this.

We also recommend, besides the exponential backoff algorithm, that you add a random delay to each attempt to prevent a thundering herd problem.

If the client keeps retrying rate-limited requests while being rejected with a 429 at a high rate, Spoke will keep rejecting the requests until you turn down the request rate.

Spoke will also limit requests if it keeps receiving them at a high frequency at or close to the requests limit for an extended period, so while we support an occasional burst of requests, if this is sustained for a long period, we will rate-limit the client making them.

While we feel these rate-limits will work for the vast majority of use cases we understand every team is different. So please reach out to us and describe your use case if these limits are not enough for you, and we will evaluate increasing them for your team.