Quick answer: Mockoon auto CRUD routes turn one data bucket into a set of generated GET, POST, PUT, PATCH, and DELETE endpoints that share state across calls, so a POST followed by a GET shows the new record. The data lives in memory for the running process only, resets on restart, and never writes back to the mock file, so it acts like a small throwaway database rather than a real backend.
What one CRUD route generates
Add a CRUD route, set its path to a resource name such as users, and link it to a data bucket. The path becomes the prefix for every generated endpoint. The HTTP method and status code are chosen automatically and the default response cannot be removed, but you can still add latency and custom headers, and the JSON content type is forced when it fits. At runtime Mockoon expands the single route into the endpoints below.
| Method and path | Behavior on an array of objects |
|---|---|
GET /users |
Returns the whole array, with filtering, sorting, and pagination |
GET /users/:id |
Returns one object matched by its id property |
POST /users |
Inserts an object, generating an id when none is provided |
PUT /users/:id |
Replaces the matched object in full |
PATCH /users/:id |
Merges into the matched object |
DELETE /users/:id |
Removes the matched object |
PUT /users |
Replaces the whole bucket content |
For an array of primitives, the :id segment acts as an index rather than a property match. When the bucket holds a single object or primitive, the write endpoints overwrite that content instead of inserting into a list. The parser is permissive, so you can push mixed types or a different shape without an error.
Ids and the read query parameters
The default key is id, but you can rename it to uuid or custom_id, or use dot notation such as data.id to key on a nested property. A POST without an id gets a UUID v4 string; if the bucket already contains an object with a numeric id, later ids increment instead. When the key uses a templated helper such as a faker object id, Mockoon keeps that format for subsequent writes.
| Query form | What it does |
|---|---|
status_eq=success |
Matches equal values, including true, false, and null |
price_gte=10 |
Numeric comparison using ne, gt, gte, lt, or lte |
name_like=john |
Partial, case-insensitive match; start and end also exist |
search=john |
Full-text match across every property |
sort=name&order=asc |
Sorts the array before pagination |
page=2&limit=25 |
Pages the array, with limit defaulting to 10 |
Filters apply first, then sorting, then pagination. The like, start, and end operators accept regex patterns, and nested paths such as user.name work the same way as top-level properties.
Where it stops being a real database
The bucket is in-memory state for one process. There is no persistence past a restart, no foreign keys or relations, no transactions, and no schema enforcement. The mock will not enforce uniqueness beyond the id, run cascades, or apply access rules. That makes it a strong fit for front-end prototypes and end-to-end tests that need write-then-read behavior, but a weak stand-in for a backend that carries real business rules. A local-first tool such as Powerduck serves mocks from the desktop main process with response overrides and recorded requests, and verifies flows through ordered scenario assertions instead of generating a stateful CRUD surface. The comparison hub covers the wider choice between these mock styles.
Frequently asked questions
Do CRUD routes save changes to the mock file? No. State lives in the running process, and a restart rebuilds the bucket from its original definition. The data file is never modified.
Can I use a key other than id? Yes. Rename the key or use dot notation for a nested property. Numeric ids auto-increment, otherwise new ids are UUID v4 strings.
Do filtering and pagination work on any bucket? They work on the main GET route for arrays. A single object or primitive returns as-is and does not paginate.
The bottom line
Auto CRUD routes give you a stateful, write-then-read mock from one bucket with almost no setup, but treat every record as disposable. Use them to drive prototypes and tests against realistic resource flows, and keep validation, relations, and durable writes in the real backend instead of assuming the mock will enforce them.
Top comments (0)