Docs menu · Quickstart

APIMock documentation

Quickstart

Go from no account to a hosted mock API answering a cURL request in about five minutes. You need a browser and a terminal; there's nothing to install.

Updated

1. Create an account

Go to Create your account and sign up with GitHub, Google, or an email and a password of at least 8 characters. If you're asked to confirm your email, open the link, then sign in.

Signing up creates your personal workspace. Its slug comes from the part of your email before the @, and every mock in the workspace is served under it:

[email protected]  →  workspace "ada"  →  https://ada.apimock.dev

If that slug is taken, a short suffix is added. The editor in the next step shows your exact URL.

2. Create an endpoint

On the Dashboard, select Create endpoint. The editor opens with a working example already filled in. Change it to:

Method        GET
Route         /api/users
Status code   200
Content-Type  application/json

Response body
[
  { "id": 1, "name": "Ada Lovelace" },
  { "id": 2, "name": "Alan Turing" }
]

Select Create endpoint at the top right. The endpoint is live as soon as it saves.

3. Call it

The Mock URL panel on the right of the editor has your full URL with a copy button, and a ready-made cURL command under Try it. Run it with -i to see the headers too:

curl -i https://ada.apimock.dev/api/users

HTTP/2 200
content-type: application/json
x-apimock-request-id: 7f3c…

[
  { "id": 1, "name": "Ada Lovelace" },
  { "id": 2, "name": "Alan Turing" }
]

Call it from your app the same way. CORS is open to every origin by default, so a frontend on localhost can fetch it directly:

const users = await fetch("https://ada.apimock.dev/api/users").then((r) => r.json());

A path with no endpoint returns 404 with No matching mock endpoint and an X-APIMock-Unmatched: true header, so a typo is easy to spot.

4. See the request

Open Request History in the sidebar. Your request is at the top, with its method, path, status and when it arrived. Select it to see its query, headers and cookies, and the response that went back with its headers and duration. Every response's X-APIMock-Request-Id header matches its entry here.

History is kept for 7 days. Request and response bodies are stored only for endpoints with Capture body previews turned on.

Next steps