Rate Limiting
All API calls are subject to rate limiting on a per-minute basis and limited to 60 requests per minute for each access token. Calls to v2 have their own, separate limit, so they don't count toward your v3 limit.
The limit is a rolling one, not a fixed window that resets on the minute: each request counts toward it for exactly one minute after you make it, then stops counting. At any moment, you can make 60 requests minus however many you made in the last 60 seconds.
Rate Limit Headers
Every response tells you where you stand, so you can slow down before you hit the limit:
| Header | Description |
|---|---|
X-RateLimit-Limit | Requests per minute your access token can make |
X-RateLimit-Remaining | Requests you can still make right now, after this one |
X-RateLimit-Reset | Seconds until your oldest request in the last minute stops counting, freeing up room for another |
Because each request stops counting on its own schedule, X-RateLimit-Remaining goes back up a little at a time as
older requests age out, and X-RateLimit-Reset counts down to the next one. Once that request stops counting, the
next-oldest takes its place, so X-RateLimit-Reset can jump back up. It's not a countdown to your whole limit refilling.
For example, a response with 57 requests left looks like this:
$ curl -i -H "x-nabis-access-token: <access-token>" \
https://customer-api.nabis.pro/v3/warehouses
> HTTP/1.1 200 OK
> X-RateLimit-Limit: 60
> X-RateLimit-Remaining: 57
> X-RateLimit-Reset: 42
Exceeded Rate Limit Response
If you exceed the rate limit for your access token, the API will respond with the following:
{
"statusCode": 429,
"message": "Too Many Requests"
}
A 429 response also includes a Retry-After header with the number of seconds to wait before trying again:
Retry-After: 42
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 42