Cosmovex Tools

Need a fake users REST API for your frontend? Get a working /users endpoint now

Users API with Mock API Studio

The editor below is preset with a users resource: id, name, username, email, avatar, role, status and timestamps. Press Create my API and you get an HTTPS base URL with a stateful /users endpoint, so a POST shows up on the next GET and a DELETE returns 404 afterwards.

  1. Check the sample in the editor. The two records show the shape; rename or add fields (phone, company, bio) and the preview of inferred field types updates as you type.
  2. Keep 25 records (the free maximum) or lower the count, then press Create my API. Pro allows up to 5,000.
  3. Copy the base URL or the .env line and point your app at it, for example fetch(`${API}/users?page=1&limit=10`).
  4. Build the screens that need state: POST /users adds a user, PATCH /users/2 with {"status":"active"} changes one, DELETE /users/2 removes it and the next GET returns 404.
  5. Exercise list features: ?q=chen searches every text field, ?role=admin filters, ?sort=createdAt&order=desc sorts, and X-Total-Count gives the total for pagination.
fake users api mock users rest apifake user data api jsondummy users endpoint for testingrandom user api with crudusers api for react practice
Open Mock API Studio Free · Pro $5/mo · no account

What to know

A users endpoint is the first thing most frontends need and the last thing the backend finishes. A static JSON file covers the list view but nothing else: sign-up forms, role editing, deactivation and delete confirmations all need an API that remembers what you did. Here every write persists in the project, so you can build the full create, edit and delete flow and see it survive a page reload.

The generated users look real enough to catch layout bugs early. Names vary in length, emails are unique and well formed, avatars are actual image URLs, and createdAt values are spread across past dates, so a table sorted by sign-up date or a long name in a narrow card behaves the way it will with production data. Your two sample records stay at the top of the list, which makes a known user easy to target in tests. Data is generated from a fixed seed, so Reset gives you the same 25 users every time.

Validation follows the field types inferred from your sample. A POST with a number in email or an unknown status string returns 422 with a JSON error that names the field, which is what you need to build and test form error states. Unknown ids return 404 and malformed JSON returns 400, all in one consistent error shape, so your error handling can be written once against this API and kept when the real one arrives.

When the backend is ready, change the base URL in .env and leave the calls alone. To keep that swap painless, mirror the response conventions you expect from production now: the list is a plain JSON array with the total in the X-Total-Count header, and pages are requested with ?page and ?limit. If your real API wraps lists in a data envelope or uses cursors, keep the adapter in one function so only that function changes.

Updated · Cosmovex

Questions

What endpoints does the fake users API have?

GET /users (list with pagination, sorting, filters and search), GET /users/:id, POST /users, PUT /users/:id, PATCH /users/:id and DELETE /users/:id. Changes persist in your project, so the API behaves like a real backend rather than returning the same fixture every time.

How do I paginate and search users?

Use ?page=2&limit=10 for pages; the response header X-Total-Count holds the total number of matching users. ?q=riley searches text fields, ?role=admin or ?status=active filter on exact values, and ?sort=createdAt&order=desc sorts the list.

Can I call it from localhost or a preview deploy?

Yes. CORS allows any origin and answers preflight requests, so fetch and axios calls from localhost, Vercel or Netlify previews and mobile emulators work without a proxy.

Are these real people's details?

No. Every name, email and avatar is generated. Emails use example domains that cannot receive mail, so it is safe to wire the API to a form that sends invitations while you build it.

How long does the users API stay up?

On the free plan the project accepts 300 requests a day and its data is cleared after 48 hours without any requests; opening the project again restores it from the seed. Pro gives 20,000 requests a day, keeps data indefinitely and adds latency and error injection for loading and failure states.

The free plan covers everything on this page. Mock API Studio Pro ($5/mo, billed monthly) is described on the Mock API Studio page.