Concepts
Stateful collections
Several routes, one store, remembered until you reset it.
Add a collection with a path and a name. The path is the collection URL. Item routes use that path plus /:id. Every route in the set uses the same collection name, so they read and write one map of id to record on that twin.
- GET on the collection lists the records as a JSON array.
- POST stores the JSON object, assigns id when it is missing, and returns 201.
- GET, PUT, and PATCH on /:id read or merge one record. PATCH of a missing id is 404. PUT of a missing id creates it.
- DELETE on /:id removes one record and returns 204.
- DELETE on the collection clears it and returns {"deleted":true}.
State is one document per twin, not per caller. It survives reloads. Reset state, or POST /sim/{slug}/__reset with a member session or API key, clears it. A more specific route, such as a static GET /v1/orders/:id, wins over the collection's read route for that call.