Rules

A rule changes traffic as it passes through: redirect it, rewrite it, pause it, delay it, or answer it from a file. Rules live in the Rules tab (⇧⌘R), group into folders, and each rule can bundle several changes. Each rule family also has a master on/off switch.

Match conditions

Every rule matches the request first. The common fields:

FieldMatches
PatternHost and path. * matches anything; a leading ~ makes it a regex; otherwise it is a prefix glob over host/path?query.
MethodA specific method, or empty for any.
GraphQLA GraphQL operation name.
Only if headername, name: text, or name: ~regex.
Only if body containsText, or ~regex.
FolderGroup rules; a folder toggles as a unit.

Paste a URL into the filter bar to see which rules would match it.

Rule types and their fields

TypeWhat it does & its fields
BreakpointPause to edit by hand. Fields: Request, Response, WebSocket messages.
Map localAnswer from a local file; the server is never hit. Fields: Status, Content-Type, Delay (ms), Headers, Body or a body file.
Map remoteRedirect to another URL. Field: Send to (e.g. http://localhost:3000).
Map folderServe a whole directory for a matching path. Field: Folder.
HeaderAdd, change or remove a header. Fields: On request / On response, Name, Value (empty removes it).
RewriteFind and replace with regex groups. Fields: Target (URL, request header, request body, status, response header, response body), Find (regex), Replace ($1 groups).
JSON patchChange fields in a JSON body, leaving the rest live (RFC 7386 merge; null deletes). Fields: Request body / Response body, the patch.
ScriptRun code on the request or response — see scripting. Fields: Language (Rhai, JavaScript, Python), On request / On response, the code.
BlockReturn a status (e.g. 403) instead of reaching the server.
Drop connectionCut the connection, to test a hard network failure.
SuspendDelay the request or response, to test slow networks and timeouts.
Replay HARAnswer from a recorded HAR file, offline. Field: the recording (.har from elcapture, a browser, Charles or Proxyman).

Edit rules as JSON

Rules are plain JSON. Export them, check them into a repo, import them back, or set them from a script or an AI agent — see the command line and MCP. You can also add most rule types straight from a request's right-click menu (Mock, Rewrite, JSON patch, Map remote, Header, Script, Block this host).