API Mock Server
Mock REST API routes with rules, delays, scenarios and a temporary public endpoint
Related Tools
What the API Mock Server does
Define routes with several responses, pick how a response is chosen (fixed, rules, sequence or random), add delays and failure statuses, and test everything in the browser. When public endpoints are enabled, you can start a temporary URL that serves the same routes to any client and shows a live request log.
Matching and precedence
Paths support literal segments, :params and a trailing * wildcard. The most specific route wins, so /users/me beats /users/:id regardless of creation order. Rules inspect the method, path parameters, query, headers, the raw or JSON body, the request count and scenario state.
Privacy and limits
The editor and Test request run in your browser. A started endpoint stores the config and the last 100 requests on CodingTool servers for at most 60 minutes, or 15 minutes without requests, and deletes them when you stop it. Cookies are never read or stored, and credential header values such as Authorization and API keys are masked before storage.
What it does not do
It never forwards requests to real APIs, never redirects, never sets cookies and never runs code. Only JSON and plain text are served, always inline and with a sandbox policy; other content types are served as plain text, and only custom X- headers and a few caching and rate-limit headers can be set.
Frequently asked questions
- Is my mock config sent to a server?
- Only when you start a public endpoint. The editor and Test request run entirely in your browser. A started endpoint keeps the routes and the last 100 requests on CodingTool servers for at most 60 minutes, or 15 minutes without requests, never reads or stores cookies, masks credential header values, and deletes everything when you stop it.
- How does the mock choose a route and a response?
- The most specific path wins: literal segments beat :params, which beat a trailing * wildcard, and definition order only breaks exact ties. The route then serves a fixed response, the first response whose rules all match, the next response in sequence, or a random one.
- Can a mock response return HTML or set cookies?
- No. Responses come from the CodingTool origin, so only JSON and plain text are served, inline and with a sandbox Content Security Policy; other content types become plain text, and cookies, redirects, CORS, caching and security headers are removed. CORS comes only from the session preset and never allows credentials.
