Employees API with Mock API Studio
The editor below is preset with an employees resource: first and last name, email, phone, job title, department, salary, hire date, birth date and employment status. Press Create my API and you get 25 employees (the free maximum; Pro holds 5,000) behind an HTTPS /employees endpoint for an HR table, an add-employee form and edit and delete actions that really persist.
- Check the five sample employees. Their department values (Engineering, Sales, Support, Finance, Marketing) and statuses (active, on_leave, terminated) become the allowed lists.
- Keep 25 employees (the free maximum) or lower the count, then press Create my API.
- Fill the HR table from GET /employees?_page=1&_limit=20&sort=lastName&order=asc and show the total from the X-Total-Count header.
- Add filters: ?department=Engineering, ?status=active, ?salary_gte=80000&salary_lte=120000, ?remote=true, or ?q=austin to search names, emails and titles.
- Wire the form: POST /employees creates one (201), PUT /employees/2 replaces it, PATCH /employees/2 with {"status":"active"} edits one field, DELETE /employees/2 removes it.
What to know
An employee table is the classic CRUD exercise for a course, a take-home test or an internal admin prototype, and the public dummy employee endpoints people reach for are shared by everyone and often return a canned response to writes. Here the dataset is yours: nobody else's test data appears in it, a created employee stays created, and a deleted one returns 404 from then on.
The fields are typed from your samples, which gives you real validation to build form errors against. A POST with "salary": "high" returns 422 naming salary, an email without an @ is rejected, a department outside the five sample values is rejected, and "remote": "yes" fails because the field is a boolean. Each error has the same shape, {"error":"validation_failed","message":"...","field":"salary"}, so one error handler covers the whole form.
Generated employees use realistic values: full first and last names, unique-looking emails, phone numbers, job titles, salaries rounded to the thousand between 30,000 and 180,000, and birth dates for ages 18 to 80. Hire dates are generated within the past year, while your samples keep their own dates. Sorting by a date or a number compares the values, not the text, so ?sort=salary&order=desc is a real top-earners view.
PUT and PATCH behave differently, which matters for edit forms. PUT /employees/1 replaces the whole record with the body you send (id is kept), so a field you leave out is gone. PATCH merges, so {"jobTitle":"Director"} changes only that field, and a field set to null is removed. If your form sends partial data, use PATCH.
Updated · Cosmovex
Questions
What does one employee record look like?
Like the samples: {"id":1,"firstName":"Sam","lastName":"Austin","email":"sam.austin@example.com","phone":"+1 555 0100","jobTitle":"Engineering Manager","department":"Engineering","salary":145000,"status":"active","remote":true,"hireDate":"2023-04-03","birthDate":"1988-06-21"}. Lists are plain JSON arrays of these.
Are the employees real people?
No. Every name, email and phone number is generated, and emails use example domains. The sample persona Sam Austin is fictional too, so the data is safe to show in a public demo or a screenshot.
How do I filter employees by salary range?
Use _gte and _lte on the field: /employees?salary_gte=60000&salary_lte=100000. Combine with ?department=Sales and ?sort=salary&order=desc. Repeat a key for either value: ?department=Sales&department=Marketing.
Can I add a departments endpoint?
Yes, as the second resource of a free project (Free keeps 2). Add a "departments" array to the JSON and replace department with departmentId on employees before you create the API; departmentId is then filled with real department ids and /employees?departmentId=2 lists one team.
Does it work for a Postman or automated API test exercise?
Yes. It is a normal HTTPS JSON API with real status codes (200, 201, 204, 400, 404, 422), so assertions on status, body and headers behave as they would against a real service. Reset to seed restores the starting data between test runs.
The free plan covers everything on this page. Mock API Studio Pro ($5/mo, billed monthly) is described on the Mock API Studio page.