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.
輸入參數urlautoseedslugspeclocale
List the connected account's mocks (API token required), with their URL, routes and expiry.
無需輸入參數。
Details of a mock: routes with identifiers, behaviour, lock, sample generated bodies per route.
輸入參數slug必填ownerToken
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.
輸入參數bodypath必填slug必填method必填headersaccessKeyownerToken
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.
輸入參數slug必填patch必填ownerToken
Set the JSON body a route returns for a given status (hand-written response); a null body restores the generated response.
輸入參數body必填slug必填route必填status必填ownerToken
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.
輸入參數bodynameslug必填when必填route必填statuslatencyMsownerToken
Remove every conditional rule of a route.
輸入參數slug必填route必填ownerToken
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.
輸入參數seedslug必填localerouteIdownerToken
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.
輸入參數slug必填limitownerToken
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.
輸入參數id必填slug必填ownerToken
Empty the mock's request log.
輸入參數slug必填ownerToken
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.
輸入參數slug必填forceownerToken
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.
輸入參數slug必填hostnameownerToken
Forget persisted writes (POST, PUT, PATCH, DELETE): the generated collections come back as they were.
輸入參數slug必填ownerToken
Lock a mock with a token (private) and/or restrict the allowed browser origins. Pro plan.
輸入參數slug必填originsprivateownerToken
Permanently delete a mock and its kept schema.
輸入參數slug必填ownerToken