On this page
Handle rate limits
Protect endpoints and help visitors continue after a limit.
Before you begin: Limit repeated activity.
Protect endpoints and preserve safe retries
Rule input (JSON)
Use a complete version 2 rule file. Select a post with “postType” and “action”, or an “endpoint” by name. Saved data, jobs, payments and email need the local server. Dedupe replay protection also needs a site.
Check complete rules or run schemas, permissions, hooks and calculations against the input above. Add excerpts to a complete rule before running.
Endpoint statements run in written order. A rateLimit statement checks and consumes its allowance when execution reaches it. There is no count option.
- Before
dedupe, it applies to every request reaching that line, including replays. - After
dedupe, it is skipped when dedupe returns a saved response, reports a conflict, or reports an in-progress request. - An earlier failed
must(...)orreturnprevents later checks from running. - Without dedupe, statements still run in written order.
You can use two policies: one before dedupe for repeated requests, another after it for new attempts. Reusing a named policy shares its allowance across endpoints. Each time its statement is reached consumes one unit, including if you deliberately reference it twice.
Put checks that must apply to every call, such as current authentication and authorization, before dedupe. Put payments, reservations, and writes after dedupe when retries must not repeat them. Statements before dedupe execute again even when a saved response exists.
An endpoint can have one top-level dedupe statement; it cannot appear inside a loop, conditional, atomic block, or helper function. A rateLimit statement can appear inside endpoint conditionals, loops, and atomic blocks: it consumes allowance each time execution reaches it. Skipped branches consume nothing. Rate-limit statements are not available in standalone helper functions or post hooks.
A later business failure or rollback does not refund rate-limit usage. A retry of a retryable failure reaches and consumes the applicable checks again. Dedupe controls replay; atomic groups database changes that must succeed together.
Cover groups of operations
Rule excerpt: add this to a complete FRL rule before running it. Try a complete example →
| Scope | Coverage |
|---|---|
site | Public site API requests, custom endpoints, and upload API requests. Static pages, assets, and fb-admin requests are excluded. |
auth | Account operations, including sign-in and registration. |
postReads | Public post and list queries. |
postWrites | Public create, edit, and delete operations. |
endpoints | Custom theme endpoints. |
uploads | Upload requests, including profile photos and upload-session operations. |
Scoped policies apply automatically; do not also attach them to individual actions. A group policy consumes one unit per matching public call, while action bindings count the requested operations. Scoped policies run before endpoint statements, including on replay.
Respond to a limit
A blocked operation returns HTTP 429, a Retry-After header in seconds, and a body such as:
Show the message near the action and let the visitor try again after the wait. Do not continuously retry. A 429 is retryable with the same dedupe key and request details; it does not permanently save a failed checkout attempt. Keep that key when a response is uncertain too.
Rate limits are checked before the protected operation runs. Earlier, broader request limits can already have counted the request even if a more specific operation limit later blocks it.
Admin adjustments
Site owners and admins with admin-management access can open Abuse and protection to see descriptions, covered operations, effective limits, allowed counts, policy blocks, and the last blocked time.
Admins can change allowances and windows within the policy's adjustable bounds or restore defaults. Adjustments take effect on subsequent requests without resetting current usage. If a later theme version makes an adjustment invalid, its defaults apply. Multiple policies can block one request, so policy-block totals are not unique visitor or request counts.
Always-on platform safety limits remain active alongside theme policies: 1,000 public API requests per minute per client IP and 60 account operations per minute per client IP. Admin adjustments cannot disable them.
Reporting periods
The Abuse and protection page shows Today by default. Choose Last 7 days, Last 30 days, or All time to compare allowed and blocked policy attempts. The 7-day and 30-day views include today. Reporting days use UTC; daily history begins when daily reporting is enabled, while existing lifetime totals remain available under All time.
Reporting periods do not change your request allowances: a policy's window continues across midnight. One request can count toward several policies, so these totals describe policy checks, not unique visitors or requests.
Built-in declarations, including sign-in and sign-up protection, carry a gold ★ System badge in the dashboard. The badge identifies their origin and remains visible when a theme customizes their defaults or an admin adjusts their limits.
Declaration keys follow the FRL naming rules, including the reserved system namespace.