Rate limit the export endpoint

Rate limit the export endpoint

SH

admin export is getting hammered by one tenant. can we rate limit just that route

09:41

Yes, and keep it off the shared middleware so the rest of the API is untouched. A fixed window per workspace is enough here because the abuse is one tenant looping, not a thundering herd:

app/api/export/route.ts

retry-after matters more than the status here: the tenant's script backs off on it, and without it they retry immediately and you have the same load with extra 429s.

09:41
SH

what do we tell the ones who hit it legitimately

09:47

Five exports a minute is far above any human pace, so a legitimate hit means they are scripting it. The 429 body names the reset, so the fix is one sleep in their loop. Worth a line in the API docs rather than a support macro.

09:48

ReUI Chat can make mistakes. Check important info.