Skip to content

Mock API Server

Log in to create a mock endpoint — the free plan includes 3.

About Mock API Server

Define a JSON response and a status code, and get a URL that returns exactly that. Useful when the backend doesn't exist yet and the frontend has to keep moving, or when you need an endpoint that reliably returns a 500 so you can check your error handling against something other than hope. Mocks return JSON only, never HTML, and expire after a week unless you extend them.

  • A URL that returns your JSON with the status code you pick
  • Simulate failures — 404, 429, 500 — that are hard to trigger for real
  • Add a delay to test timeouts and spinners
  • Served from a separate origin, so it can never touch your session

How to create a mock API endpoint

  1. 1Paste the JSON body you want the endpoint to return.
  2. 2Choose a status code — 200, or a failure you want to handle.
  3. 3Copy the URL and point your code at it.
  4. 4Delete it when the real API is ready, or let it expire.

Frequently asked questions

Can a mock return HTML?
No, deliberately. Bodies must parse as JSON and are always served as application/json with nosniff. A tool that serves arbitrary HTML from our domain would be a phishing vector, and one abusive user could get the whole domain flagged.
How long does a mock last?
Seven days by default, up to thirty. Expired mocks return 410 rather than 404, so it is clear the URL was real and simply timed out.
Why is it on a different domain?
Because it serves content you define. Your session token is scoped to the main origin, so putting user-defined responses on a separate host means a bug in our content checks could never reach it.
Does calling a mock use my quota?
No. Creating a mock counts against your plan; requests to it do not. A mock URL is public once you share it, and we are not going to let a stranger drain your quota by calling it in a loop. Each mock is rate limited instead.
Can I redirect from a mock?
No. Redirect status codes are refused, because an endpoint that redirects anywhere is an open redirector and would attract exactly the abuse this design avoids.