temp-api
← Back to Mock APIs

Mock Users API

8 fixed user records for login flows, lists, detail pages, roles, and related queries.

Data8 user records Base URLhttps://www.temp-api.com/en/mock Response{ code, message, data, meta }

Endpoints

GET/en/mock/users

User list with page, limit, q, role, status, and city.

Open
GET/en/mock/users/1

Single user detail.

Open
POST/en/mock/users

Simulated create; returns a new id and stores nothing.

Related routes

GET/en/mock/users/1/posts

Posts by this user

Open
GET/en/mock/users/1/todos

Todos for this user

Open
GET/en/mock/users/1/orders

Orders for this user

Open
GET/en/mock/users/1/comments

Comments by this user

Open

Filters

page, limit, q, role, status, city

Fields

FieldTypeDescription
idnumberUser ID
namestringFull name
emailstringEmail address
citystringCity
rolestringRole, e.g. admin / member
statusstringStatus, e.g. active / inactive
created_atstringISO timestamp

Notes

  • Writes are simulated and never stored; GET responses are cached for 60 seconds.

Common mistakes

  • Out-of-range pages return an empty list, not a 404page=99 still returns 200 with an empty data array, and meta.total stays 8. Render the empty state yourself.
  • limit is capped at 50Passing 100 is treated as 50. No error is returned.
  • GET responses are cached for 60 secondsThe header is Cache-Control: public, max-age=60. If a change does not show up while debugging, rule out the cache first.
  • Writes are not storedPOST returns 201 with a new id, but the record never appears in the list.

Example

curl "https://www.temp-api.com/en/mock/users?limit=3"
{
  "code": 200,
  "message": "ok",
  "data": [
    { "id": 1, "name": "Emily Carter", "role": "admin", "status": "active" }
  ],
  "meta": { "page": 1, "limit": 3, "total": 8, "total_pages": 3 }
}

Related resources