# limit.rate

Too many requests in a short time; the caller should wait

Profile: [Errors](https://www.prongs.dev/docs/intents/errors.md) · Raised with: [`fail()`](https://www.prongs.dev/docs/profiles/errors.md) · Status: `429` · Message: yours · Retryable: yes · Writes: [`security.limited`](https://www.prongs.dev/docs/intents/security/limited.md)

## Example

```ts
return fail('limit.rate', undefined, { retryAfter: 30 });
```

The caller gets

```bash
HTTP 429
Retry-After: 30

{
  "ok": false,
  "error": "Too many requests. Try again shortly.",
  "code": "limit.rate"
}
```

And it writes security.limited

```ts
{
  "intent": "security.limited",
  "level": "warn",
  "alert": false,
  "message": "Too many requests. Try again shortly.",
  "data": {
    "intent": "limit.rate"
  },
  "time": "2026-10-09T12:00:00.000Z"
}
```

## Choosing between neighbours

Find the row that describes your case, and use the intent on the right.

| If it is for… | Use |
|---|---|
| Too many requests in a short time; the caller should wait | `limit.rate` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`status.toomany`](https://www.prongs.dev/docs/intents/errors.md#status-toomany)
- Writes: [`security.limited`](https://www.prongs.dev/docs/intents/security/limited.md)

## For registry authors

**Starter intents.** These are the intents `prongs add errors` puts in your registry, raised with [`fail()`](https://www.prongs.dev/docs/profiles/errors.md). Change the messages to suit your app, and the statuses through the [`status.*`](https://www.prongs.dev/docs/intents/errors.md#status) intents they are built from.

The entry `prongs add errors` writes into your registry. Change the message here, or the status through its [`status.*`](https://www.prongs.dev/docs/intents/errors.md#status) ref.

```ts
'limit.rate': {
  kind: 'semantic',
  description: 'Too many requests in a short time; the caller should wait',
  refs: ['status.toomany'],
  keywords: ['rate', 'throttle', 'too many'],
  binding: {
    publicMessage: 'Too many requests. Try again shortly.',
    retryable: true,
    logs: 'security.limited',
  },
},
```
