Create a hosted mock from an OpenAPI 3.0/3.1 or Swagger 2.0 document (YAML or JSON), from TypeScript types (interfaces, types, enums: CRUD routes derived, or a route map type keyed like "GET /users") or from a Postman v2 collection, an Insomnia export (v4 JSON or v5 YAML), a Bruno collection (JSON export, or .bru files one after the other), a HAR file (headers and cookies are dropped, data is generated), a json-server db.json (records served as they are), curl commands, or a GraphQL schema (SDL or introspection JSON; Pro plan: queries, mutations and introspection answered on POST /graphql). OpenAPI 3.2 is read too. Give the document in `spec`, or its public address in `url` (then the mock re-reads it every six hours and follows changes). Returns the URL, the route list and an ownerToken to keep for later changes. Data is realistic and coherent, generated once. Without an account the mock lives seven days.
Parametersurlautoseedslugspeclocale
List the connected account's mocks (API token required), with their URL, routes and expiry.
Takes no parameters.
Details of a mock: routes with identifiers, behaviour, lock, sample generated bodies per route.
ParametersslugrequiredownerToken
Call a route of the mock like an HTTP client would and return the status, the x-loutre-* headers and the body. The headers x-loutre-status, x-loutre-delay, x-loutre-count, x-loutre-message and x-loutre-seed are honoured; latency is not awaited, it is reported in delayMs. Writes (POST, PUT, PATCH, DELETE) are persisted when persistent state is on. For a GraphQL mock, POST to its GraphQL path with the body { "query": "…", "variables": { … } }; mutations are persisted the same way.
ParametersbodypathrequiredslugrequiredmethodrequiredheadersaccessKeyownerToken
Change a mock's behaviour: default status, latency, jitter, error rate, persistent writes, and per route status, latency, hand-written bodies, rules. Merge semantics: missing keys are kept, null clears.
ParametersslugrequiredpatchrequiredownerToken
Set the JSON body a route returns for a given status (hand-written response); a null body restores the generated response.
ParametersbodyrequiredslugrequiredrouterequiredstatusrequiredownerToken
Add a conditional response to a route: when the request matches the conditions (query, header, path param, body field), the mock answers with this status, body and latency. Rules are evaluated in order, the first match wins; x-loutre-* headers keep priority.
ParametersbodynameslugrequiredwhenrequiredrouterequiredstatuslatencyMsownerToken
Remove every conditional rule of a route.
ParametersslugrequiredrouterequiredownerToken
Generate a new data set (new seed), for the whole mock or for one route and the routes sharing its collection. A full new set forgets persisted writes.
ParametersseedslugrequiredlocalerouteIdownerToken
The latest requests received by the mock, most recent first: method, path, query, status, headers and body as received (body cut at 8 KB), where the answer came from, latency. Each entry has an id for replay_request.
ParametersslugrequiredlimitownerToken
Replay a request from the log exactly as it was received (same method, path, headers and body) against the mock as it is now, and return the answer. Useful after changing a rule, a body or a scenario.
ParametersidrequiredslugrequiredownerToken
Empty the mock's request log.
ParametersslugrequiredownerToken
Re-read the schema at the mock's source URL now and update the mock if it changed (routes, fields; settings kept, persisted writes forgotten). force regenerates even when the document is unchanged.
ParametersslugrequiredforceownerToken
Serve the mock under the account's own hostname (Pro): declares it at Cloudflare and returns the CNAME to create (hostname → target) plus the current status; call again without hostname to re-check, or with hostname null to remove it.
ParametersslugrequiredhostnameownerToken
Forget persisted writes (POST, PUT, PATCH, DELETE): the generated collections come back as they were.
ParametersslugrequiredownerToken
Lock a mock with a token (private) and/or restrict the allowed browser origins. Pro plan.
ParametersslugrequiredoriginsprivateownerToken
Permanently delete a mock and its kept schema.
ParametersslugrequiredownerToken