# Rate limits

projqo counts calls **per token** and **per organisation**, each per minute. Both limits apply: a token stays under its own limit, and all the tokens and apps of an organisation together stay under the organisation's.

A call refused because its own token or app is over its limit doesn't count toward the organisation's minute, so one busy script can't use up the minute for everyone else.

## The limits by plan

| Plan | Per token, a minute | Per organisation, a minute | Webhook deliveries, a day |
|---|---|---|---|
| Free | 60 | 300 | 1,000 |
| Standard | 300 | 1,500 | 100,000 |
| Premium | 600 | 3,000 | 250,000 |
| Enterprise | 1,200 | 6,000 | By agreement |

The API and webhooks are on every plan, Free included. The numbers are each plan's at the time of this release; your organisation's own limit is in the `RateLimit-Limit` header of every answer.

- A **bulk** call counts as one call for every 10 items: a bulk update of 100 tasks counts as 10 calls.
- The OAuth token endpoint has limits of its own.

## The headers

Every answer says where you stand:

| Header                | Means                                    |
| --------------------- | ---------------------------------------- |
| `RateLimit-Limit`     | The calls allowed in the current minute. |
| `RateLimit-Remaining` | The calls left in it.                    |
| `RateLimit-Reset`     | Seconds until the window moves on.       |

## At the limit

A call over the limit answers `429` with the code `rate_limited` and a `Retry-After` header, in seconds. Wait that long, then go on.

There is no lock-out: calls work again as soon as the window moves on, and a burst never blocks you for longer than that.

:::tabs

```js title="JavaScript"
async function call(url, init) {
  for (;;) {
    const res = await fetch(url, init);
    if (res.status !== 429) return res;
    const wait = Number(res.headers.get("Retry-After") ?? "1");
    await new Promise((r) => setTimeout(r, wait * 1000));
  }
}
```

```py title="Python"
import time

import requests

def call(method, url, **kw):
    while True:
        res = requests.request(method, url, **kw)
        if res.status_code != 429:
            return res
        time.sleep(int(res.headers.get("Retry-After", "1")))
```

:::

## Staying well under

- Ask for what changed: `updated_since` on every list, and the deleted-items feeds, instead of reading everything again.
- Use [webhooks](/guides/webhooks/) instead of asking every few seconds whether something changed.
- Use the bulk calls for many tasks at once.
- Choose only the fields you need with `fields=`, and big pages with `limit=200`.
- Keep answers you read often, such as statuses, fields and people, and read them again now and then.
- Watch `RateLimit-Remaining` and slow down before it reaches 0.
