# Rate limits

There's no global quota. A few specific things are limited, each for a reason: the ones that make us do DNS lookups, send email or create accounts.

## The limits

| Action | Limit | Counted | Applies to |
| --- | --- | --- | --- |
| Run a check | 1 every 10 seconds | Per claim | [Run a check](https://www.prufy.dev/docs/api-reference/run-check.md) and [Run a check by setup link](https://www.prufy.dev/docs/api-reference/run-setup-check.md) share it |
| Start a claim | 20 an hour | Per account | [Create a claim](https://www.prufy.dev/docs/api-reference/create-claim.md). Getting an existing claim back doesn't count |
| Start a session | 10 an hour | Per network address | [Create a claim](https://www.prufy.dev/docs/api-reference/create-claim.md), when sent without a session cookie |
| Make a setup link | 10 an hour | Per claim | [Create a setup link](https://www.prufy.dev/docs/api-reference/create-setup-link.md), without `email` |
| Email a setup link | 5 an hour | Per account | [Create a setup link](https://www.prufy.dev/docs/api-reference/create-setup-link.md), with `email` |
| Email a setup link | 10 an hour | Per network address | The same request, counted across every account on that network |
| Email a setup link | 3 every 24 hours | Per recipient | The same request, counted across every account that emails that address |
| Change the alert email | 5 an hour | Per account | [Set the alert email](https://www.prufy.dev/docs/api-reference/set-alert-email.md) |
| Send a test alert | 10 an hour | Per account | [Send a test alert](https://www.prufy.dev/docs/api-reference/send-test-alert.md) |

Reading is never limited. Listing claims and retrieving one can be done as often as you like.

## How they're counted

Each limit is a sliding window. What counts is how many times the thing was done in the hour (or the 10 seconds, or the 24 hours) before this request, not since the top of the clock. So the next one is allowed the moment the oldest one ages out, and `retryAfter` is exactly that long.

A refused request doesn't count against the limit that refused it. Retrying early can't push the window further away, it just gets the same answer with a smaller number.

An emailed setup link is the one action counted three ways: by account, then by network address, then by recipient. It's sent only when all three allow it. One that a later limit refuses has already counted towards the earlier ones.

The tally is kept in the database, so every server instance shares it. The checks we run on our own schedule aren't counted against anything.

> **Invites have the tightest limits on purpose**
>
> An emailed setup link goes to an address nobody has confirmed, and accounts are free. 5 an hour is enough to hand a domain to a colleague. The limits per network address and per recipient are what keep that true when someone makes more accounts: one inbox gets at most 3 in 24 hours, whoever sends them, and past that the answer says to copy the link and send it yourself. A `note` can't contain a link either. That one is a `400`, not a `429`.

## A limited response

The status is `429`, the kind is `rate_limited`, and the wait is in two places: `retryAfter` in the body and the `retry-after` header, both in seconds.

Too soon 429 Too many requests

```json
{
  "error": {
    "kind": "rate_limited",
    "message": "You can check again in 10 seconds.",
    "retryAfter": 10
  }
}
```

## Following a claim without meeting a limit

A claim says when things will happen, so there's nothing to guess. Retrieve it as often as you need: that's free. Leave the checking to us.

| Field | What it tells you |
| --- | --- |
| `view.timing.nextCheckAt` | When we'll look next on our own. Read the claim again after this. |
| `view.timing.canCheckNowAt` | When [Run a check](https://www.prufy.dev/docs/api-reference/run-check.md) is allowed again. Null means now. Wait until this time and the request can't be limited. |
| `view.explanation.action.kind` | `wait` means a check wouldn't help: the record is right and DNS is catching up. |

On a verified or at-risk claim, `nextCheckAt` and `canCheckNowAt` sit directly on `view`. The schedule itself is on the [Claim lifecycle](https://www.prufy.dev/docs/claim-lifecycle.md) page.

---

Every page of these docs, as a list: https://www.prufy.dev/llms.txt
