Mocks and overrides
Swap any API response for your session - without touching staging.
On this page
A mock (we call it an override in the API) replaces what your app receives for a specific request. Need GET /api/cart to return an empty cart? Create a mock. Need POST /api/pay to return a 402? Same idea.
By default, mocks only apply to your session. Staging keeps humming along for everyone else.
The mock library
Each environment has a mock library - a collection of reusable response overrides. Think of it as a menu of test states you can pick from:
- Empty cart
- Payment declined
- Server error on checkout
- Slow shipping quote
Create mocks once, activate them per session whenever you need them.
Matchers
Mocks match requests by:
- HTTP method - GET, POST, PUT, etc.
- Path -
/api/cart,/api/users/:id - Query parameters - optional, for finer matching
- Request body - optional, for POST/PUT matching
More specific matchers win over generic ones. A mock for POST /api/pay with body { "amount": 0 } beats a mock for POST /api/pay alone.
Drafts vs published
Mocks start as drafts - visible only to you, safe to experiment with. A draft you create from a request is on for your session right away, so you can see it work before anyone else knows it exists. When you're happy, publish the mock to the library so anyone on the team can turn it on for their own session.
| State | Who sees it | Who can turn it on |
|---|---|---|
| Draft | Just you | You, for your own session |
| Published | Whole team | Anyone, per session |
Activating mocks
Once published, activate a mock for your session:
- Dashboard - claim your session in the session strip, then toggle mocks on for you
- Browser extension - the Active view in the DevTools FlowMock tab lists what is on for you, and Turn on a mock or scenario switches on anything from the library
- Scenario - bundle mocks into a preset and switch the whole set at once
- Public API -
PUT /sessions/:keywith anoverridesarray, or toggle individually
You can also create a draft from a row in Traffic. With a claimed session it turns on for you immediately; without one, the draft is saved inactive until you select a session and turn it on. In the browser extension, Mock on any request in DevTools creates a draft that is on for your session straight away.
Mocks stack with your active scenario. Session-specific activations layer on top.
Response types
A mock can:
- Return a body with a chosen status code. Pick the response type - JSON, Text, HTML, XML, or File - and FlowMock sets the matching
Content-Type - Return headers alongside the body
- Add a delay before responding (great for loading states)
The browser extension's quick editor handles JSON bodies, status, headers, and delay. Open the mock in the dashboard for the other response types, matchers, and AI edit.
When you're editing a body (from Traffic or the mock editor), AI edit lets you describe the change in plain English instead of wrestling the JSON by hand - useful for "empty this list" or "mark every task critical" on a real captured payload.
Transforms (reshaping upstream or mocked response bodies) are a separate feature — mocks fully replace the response (status, headers, body, delay). Pair them when you need error states plus body patches. See Transforms for path language, expressions, seeded fakes, preview, and stacking semantics.
Tips for good mocks
- Name them clearly - "Payment declined (402)" beats "mock 7"
- Start specific - narrow matchers reduce accidental matches
- Publish when stable - drafts are for iteration, published mocks are for the team
- Use scenarios for bundles - don't manually toggle five mocks every time
Related
- Browser extension - mock any request from DevTools
- QA sessions - claim identity so mocks apply to you
- Traffic - mock from a captured request
- Transforms - patch bodies after mock or upstream
- Scenarios - switch between mock bundles
- Overrides API - toggle mocks from CI
- How it works - when mocks apply vs pass-through
- Awareness headers - confirm a mock fired from the response itself