Skip to main content

API Mock Server

Mock REST API routes with rules, delays, scenarios and a temporary public endpoint

Precedence order

3 of 50 routes

Route

Response mode

Serves the first response whose rules all match, otherwise the default response.

Responses

Headers

Allowed headers: custom X- headers, ETag, Last-Modified, Content-Language, Retry-After, RateLimit, Deprecation and Sunset. Others are removed.

Response body

75 B / 256 KB

Rules

All rules of a response must match. Responses without rules are skipped and only serve as the default.

Scenarios

Add a scenario to use scenario rules and transitions.

Public endpoint

Not started
Checking availability…

Any website can read the responses, without cookies.

Limits
  • 50 routes, 10 responses each
  • 256 KB per request and response body
  • 10 s maximum delay
  • Last 100 requests kept
  • 300 requests per minute

Mock only: no forwarding to real APIs, no redirects, no cookies and no server-side code.

Request log

Start the endpoint to see incoming requests.

Export

Exports routes and responses only. Endpoint URLs and request logs are never included.

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.

CodingTool is officially live on