Rate limits
Where limiting is applied, the defaults, and how to respond to a 429.
Rate limits
Where limiting is applied
Rate limiting is applied to the endpoints that can be abused by an anonymous caller, not to every route. Today that is:
- POST /api/newsletter — 5 requests per minute per IP.
- The shared form handler in lib/forms/handler.ts, which backs /api/contact, /api/careers and /api/quote — limited per minute by the maxPerMinute argument each caller passes.
Authenticated dashboard routes rely on the session instead: a caller has to be signed in, and every write is attributed and recorded in the activity feed.
Defaults
lib/rate-limit.ts uses a fixed window with windowMs = 60000 and max = 5 unless the caller overrides them. The counter is in-process, so it resets when the server process restarts and is per instance rather than globally shared.
What a limited response looks like
HTTP/1.1 429 Too Many Requests
{ "success": false, "message": "Too many requests. Please try again later." }Handling it in a client
- Read the 429 and stop retrying immediately.
- Wait for the window to roll over — at most windowMs.
- Retry once. If it fails again, surface the message to the person rather than looping.
Changing a limit
Pass your own window and max where the limiter is constructed. Keep the values in the route file next to the handler so the limit is discoverable, and add any new environment-driven value to .env.example with a note about where it comes from.
Bulk work
If you need to move a lot of tasks, use POST /api/tasks/bulk once instead of many single writes, and GET /api/reports/export for downloads rather than paging through a list endpoint.