A user list, a profile page or an admin table needs user records before the real backend has any. The users template gives you a small REST API with generated people behind a real URL: list, detail, create, update and delete.
What you get
The template creates a project with the base path /users-api and 5 endpoints. Each endpoint has one ready response, so the API answers as soon as the project exists.
| Method | Path | What it answers |
|---|---|---|
GET |
/users |
200 with ten generated users. |
GET |
/users/:id |
200 with one user. The id is the one from the path. |
POST |
/users |
201 with name and email from the request body and a generated id. |
PUT |
/users/:id |
200 with the id from the path and name, email and role from the request body. |
DELETE |
/users/:id |
204 without a body. |
A user in the list has id, name, email, role (admin, member or viewer), avatarUrl and createdAt. The single user also has company and city. Names are invented, email addresses use reserved example domains, and avatarUrl points to a placeholder image that Mockhop serves itself.
Sample response
$ curl -s $URL/users-api/users/42
{
"id": "42",
"name": "Mira Keller",
"email": "dana.whitfield27@example.org",
"role": "member",
"company": "Northwind Tools",
"city": "Lyon",
"avatarUrl": "https://app.mockhop.com/api/v1/placeholder/avatar/mira-keller.svg",
"createdAt": "2026-08-03"
}
The id is the one from the path. Everything else is generated on every call, so two calls for the same id return two different people. Name and email are generated separately and don't match.
How to start
- Sign up at
https://app.mockhop.com/register. The quickstart explains the account and the address of your organization. - Open Projects and select Start from a template.
- Choose Example users API and select Use template.
Then call the mock. Replace acme with your organization's address. Your mocks answer from outside once you've confirmed your email address.
$ URL=https://acme.mockhop.cloud
$ curl -s $URL/users-api/users
$ curl -s -X POST $URL/users-api/users \
-H "Content-Type: application/json" \
-d '{"name":"Mira Keller","email":"mira@example.com"}'
The first call returns ten users. The second answers 201 with the name and email you sent, a generated id and the role member.
What to do next
- Change the responses. Open an endpoint and edit the status code, headers and body of its response, or add more responses with matching rules.
- Add error cases and delays. For example a
404for an unknown user, a422with validation messages onPOST /users, or a delay to see your loading state. See Simulate API errors, timeouts and rate limits. - Use scenarios for flows. For example
GET /users/:idthat answers404on the first call and200on the next one. See Scenarios; scenarios are included from the Pro plan. - Export the project. Under Import/Export you can download the project as an OpenAPI 3.0 file.
Good to know
- Responses are generated per request and the mock keeps no state. A user you create with
POST /usersdoes not appear inGET /users, and a deleted user can still be fetched. PUT /users/:idreturns the fields from your request body. Anameoremailyou leave out is filled with a generated value, androlefalls back tomember.GET /usersalways returns ten users with the ids1to10. There is no paging, filtering or search.- The template creates a new project, and no other project in your organization may use the base path
/users-api. The Free plan includes one project. - You can change or delete the project and each of its endpoints at any time.
New to Mockhop? Start with the quickstart. Plans: pricing.