Skip to content

Rate limits

The API limits the requests of each API key and of each OAuth client. The browser session of the ERP has no such limit.

Credential Counted for Default limit
API key (personal or service) The key 600 requests a minute
OAuth access token (user token or server client token) The client in one tenant 600 requests a minute

The operator of a Posto server can change the defaults. The API key limit and the OAuth limit are separate settings.

An OAuth client has a separate count in each tenant. Two clients in the same tenant have separate counts.

  • The API counts in fixed minutes of the database clock. Each minute starts at second 0. The count starts again at 0 in each new minute.
  • Each request counts, also a request that fails. A request that gets 422 or 500 counts too.
  • All servers of the API share one count, because the count is in the database. More servers do not give more requests.

The request that goes over the limit gets 429 with a Retry-After header. The header gives the seconds until the minute ends:

HTTP/1.1 429 Too Many Requests
Retry-After: 51
Content-Type: application/json
{"error":{"code":"rate_limited","message":"Too many requests. Try again later."}}

Each request after it in the same minute also gets 429. The API does not do the action of a refused request.

  1. Read a list once, and keep the rows that you need. The list routes return all rows in one answer.
  2. On 429, wait the seconds of Retry-After. Then send the request again.
  3. Use one key for each program. Then one busy program does not stop the others.

In production, the endpoints under /api/auth have their own rate limit. It is not the limit on this page.