Skip to content
Mock APIs

Resources

Users

Fictional user profiles with contact details, address, company, and role. Users own posts, todos, comments, carts, and recipes. The dataset contains 100 users.

Writes are simulated

POST, PUT, PATCH, and DELETE validate your input and return realistic responses, but the shared dataset is never modified.

Endpoints

The user object

Use select to return a subset of these fields. Sort with sortBy on id, firstName, lastName, username, age, birthDate; search matches firstName, lastName, username, email. See query parameters.

user fields
FieldTypeNotes
idintegermin -9007199254740991, max 9007199254740991
firstNamestring
lastNamestring
usernamestring
emailstring
phonestring
ageintegermin -9007199254740991, max 9007199254740991
gender"female" | "male" | "non-binary"
birthDatestring
imagestring
role"admin" | "moderator" | "user"
addressobject
address.streetstring
address.citystring
address.statestring
address.postalCodestring
address.countrystring
companyobject
company.namestring
company.departmentstring
company.titlestring

List users

GET/api/v1/users

Returns a paginated list of users. Supports pagination, field selection, sorting, and filtering.

Parameters

Parameters for List users
NameInTypeDescription
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company.
sortByquerystringField to sort by.One of: id, firstName, lastName, username, age, birthDateDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
rolequerystringFilter by role.One of: admin, moderator, user
genderquerystringFilter by gender.One of: female, male, non-binary
cityquerystringFilter by city (case-insensitive exact match).
minAgequeryintegerMinimum age (inclusive).
maxAgequeryintegerMaximum age (inclusive).
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200A page of users with total, skip, and limit metadata.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 429Too many requests from this IP (RATE_LIMIT_EXCEEDED).
  • 503The database is temporarily unavailable (SERVICE_UNAVAILABLE).

Request

curl 'https://test.naimulhassan.me/api/v1/users?limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "users": [
    {
      "id": 1,
      "firstName": "Emily",
      "lastName": "Carter",
      "username": "emilyc",
      "email": "emily.carter@example.com",
      "phone": "+1 555-0100",
      "age": 32,
      "gender": "female",
      "birthDate": "1993-02-08",
      "image": "https://test.naimulhassan.me/api/v1/images/users/1",
      "role": "admin",
      "address": {
        "street": "3335 Lakeview Terrace",
        "city": "Denver",
        "state": "Colorado",
        "postalCode": "97836",
        "country": "United States"
      },
      "company": {
        "name": "Evergreen Robotics",
        "department": "Engineering",
        "title": "DevOps Engineer"
      }
    },
    {
      "id": 2,
      "firstName": "Michael",
      "lastName": "Brooks",
      "username": "michaelb",
      "email": "michael.brooks@example.com",
      "phone": "+1 555-0101",
      "age": 41,
      "gender": "male",
      "birthDate": "1984-09-10",
      "image": "https://test.naimulhassan.me/api/v1/images/users/2",
      "role": "user",
      "address": {
        "street": "6332 Willow Drive",
        "city": "Portland",
        "state": "Oregon",
        "postalCode": "86238",
        "country": "United States"
      },
      "company": {
        "name": "Tidewater Finance",
        "department": "Engineering",
        "title": "Engineering Manager"
      }
    }
  ],
  "total": 100,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.
GET/api/v1/users/search

Case-insensitive search across firstName, lastName, username, email. Returns an empty users array with total: 0 when nothing matches.

Parameters

Parameters for Search users
NameInTypeDescription
qrequiredquerystringSearch term (1-100 characters).
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company.
sortByquerystringField to sort by.One of: id, firstName, lastName, username, age, birthDateDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200Matching users (possibly empty).
  • 400Missing or invalid q parameter (INVALID_PARAMETER).
  • 429Too many requests from this IP (RATE_LIMIT_EXCEEDED).

Request

curl 'https://test.naimulhassan.me/api/v1/users/search?q=emily&limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "users": [
    {
      "id": 1,
      "firstName": "Emily",
      "lastName": "Carter",
      "username": "emilyc",
      "email": "emily.carter@example.com",
      "phone": "+1 555-0100",
      "age": 32,
      "gender": "female",
      "birthDate": "1993-02-08",
      "image": "https://test.naimulhassan.me/api/v1/images/users/1",
      "role": "admin",
      "address": {
        "street": "3335 Lakeview Terrace",
        "city": "Denver",
        "state": "Colorado",
        "postalCode": "97836",
        "country": "United States"
      },
      "company": {
        "name": "Evergreen Robotics",
        "department": "Engineering",
        "title": "DevOps Engineer"
      }
    },
    {
      "id": 56,
      "firstName": "Emily",
      "lastName": "Lopez",
      "username": "emilyl",
      "email": "emily.lopez56@example.com",
      "phone": "+1 555-0155",
      "age": 21,
      "gender": "female",
      "birthDate": "2004-01-22",
      "image": "https://test.naimulhassan.me/api/v1/images/users/56",
      "role": "user",
      "address": {
        "street": "6743 Elm Court",
        "city": "Denver",
        "state": "Colorado",
        "postalCode": "46931",
        "country": "United States"
      },
      "company": {
        "name": "Harborline Logistics",
        "department": "Engineering",
        "title": "Senior Software Engineer"
      }
    }
  ],
  "total": 2,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

Get a user

GET/api/v1/users/{id}

Returns a single user by its numeric ID.

Parameters

Parameters for Get a user
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company.
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200The user object.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).

Request

curl 'https://test.naimulhassan.me/api/v1/users/1'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "firstName": "Emily",
  "lastName": "Carter",
  "username": "emilyc",
  "email": "emily.carter@example.com",
  "phone": "+1 555-0100",
  "age": 32,
  "gender": "female",
  "birthDate": "1993-02-08",
  "image": "https://test.naimulhassan.me/api/v1/images/users/1",
  "role": "admin",
  "address": {
    "street": "3335 Lakeview Terrace",
    "city": "Denver",
    "state": "Colorado",
    "postalCode": "97836",
    "country": "United States"
  },
  "company": {
    "name": "Evergreen Robotics",
    "department": "Engineering",
    "title": "DevOps Engineer"
  }
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

List a user's posts

GET/api/v1/users/{id}/posts

Returns posts whose userId matches the user ID. Returns 404 if the user does not exist.

Parameters

Parameters for List a user's posts
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, title, body, userId, tags, reactions, views.
sortByquerystringField to sort by.One of: id, title, views, userIdDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200A page of posts.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404The user does not exist (RESOURCE_NOT_FOUND).

Request

curl 'https://test.naimulhassan.me/api/v1/users/1/posts?limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "posts": [
    {
      "id": 1,
      "title": "Why I write tests before fixing bugs",
      "body": "Writing the failing test first made the bug impossible to ignore. Pairing for an hour was faster than a day of back-and-forth messages. Clear error messages turned out to be the best documentation we had.",
      "userId": 1,
      "tags": [
        "coding",
        "weekend"
      ],
      "reactions": {
        "likes": 398,
        "dislikes": 28
      },
      "views": 1472
    },
    {
      "id": 2,
      "title": "My slow Sunday pour-over routine",
      "body": "Sharing a pot with neighbors turned into a weekly tradition. Fresh water and a clean kettle make a bigger difference than I expected. Weighing the beans felt fussy at first, but the cups became noticeably more consistent.",
      "userId": 1,
      "tags": [
        "coffee",
        "learning",
        "beginners"
      ],
      "reactions": {
        "likes": 330,
        "dislikes": 8
      },
      "views": 1187
    }
  ],
  "total": 3,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

List a user's todos

GET/api/v1/users/{id}/todos

Returns todos whose userId matches the user ID. Returns 404 if the user does not exist.

Parameters

Parameters for List a user's todos
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId.
sortByquerystringField to sort by.One of: id, todo, userIdDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200A page of todos.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404The user does not exist (RESOURCE_NOT_FOUND).

Request

curl 'https://test.naimulhassan.me/api/v1/users/1/todos?limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "todos": [
    {
      "id": 1,
      "todo": "Reply to project kickoff email",
      "completed": false,
      "userId": 1
    },
    {
      "id": 156,
      "todo": "Write unit tests for the login form",
      "completed": true,
      "userId": 1
    }
  ],
  "total": 2,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

List a user's carts

GET/api/v1/users/{id}/carts

Returns carts whose userId matches the user ID. Returns 404 if the user does not exist.

Parameters

Parameters for List a user's carts
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1
limitqueryintegerNumber of records to return (1-100).Default: 30Range: 1-100
skipqueryintegerNumber of records to skip before returning results.Default: 0Range: 0-1000000
selectquerystringComma-separated list of fields to return. id is always included. Allowed: id, userId, products, total, discountedTotal, totalProducts, totalQuantity.
sortByquerystringField to sort by.One of: id, userId, total, discountedTotal, totalQuantityDefault: id
orderquerystringSort direction.One of: asc, descDefault: asc
delayqueryintegerDelay the response by this many milliseconds (0-5000). Subject to a stricter rate limit.Range: 0-5000

Status codes

  • 200A page of carts.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404The user does not exist (RESOURCE_NOT_FOUND).

Request

curl 'https://test.naimulhassan.me/api/v1/users/1/carts?limit=2'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "carts": [
    {
      "id": 1,
      "userId": 1,
      "products": [
        {
          "id": 100,
          "title": "Aquaform Kickboard",
          "price": 117.99,
          "quantity": 2,
          "total": 235.98,
          "discountPercentage": 0.09,
          "discountedTotal": 235.77,
          "thumbnail": "https://test.naimulhassan.me/api/v1/images/products/100"
        },
        {
          "id": 7,
          "title": "Orbitel One Smartphone",
          "price": 1192.99,
          "quantity": 2,
          "total": 2385.98,
          "discountPercentage": 13.24,
          "discountedTotal": 2070.08,
          "thumbnail": "https://test.naimulhassan.me/api/v1/images/products/7"
        },
        {
          "id": 49,
          "title": "Lumio Watch Sport Strap",
          "price": 546.99,
          "quantity": 4,
          "total": 2187.96,
          "discountPercentage": 1.02,
          "discountedTotal": 2165.64,
          "thumbnail": "https://test.naimulhassan.me/api/v1/images/products/49"
        }
      ],
      "total": 4809.92,
      "discountedTotal": 4471.49,
      "totalProducts": 3,
      "totalQuantity": 8
    }
  ],
  "total": 1,
  "skip": 0,
  "limit": 2
}

Try it

GET
Headers

No header yet.

Open in playground
Send the request to see a live response.

Create a user (simulated)

POST/api/v1/users
Simulated - not persisted

Validates the body and returns the user as it would be created, with the next available ID. Nothing is persisted: the shared dataset is never modified.

Headers

Headers for Create a user (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Users fields.

Body fields for Create a user (simulated)
FieldTypeRequiredNotes
namestringNomin length 1, max length 100
firstNamestringNomin length 1, max length 50
lastNamestringNomin length 1, max length 50
usernamestringNo
emailstring (email)Yes
ageintegerNomin 1, max 120
gender"female" | "male" | "non-binary"No
phonestringNomin length 3, max length 30

Status codes

  • 201The simulated user, including its new id.
  • 400The request body is not valid JSON (INVALID_JSON).
  • 409The email or username is already used by a seeded user (CONFLICT).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X POST 'https://test.naimulhassan.me/api/v1/users' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Alex Morgan",
  "email": "alex@example.com"
}'

Example responses

Captured from the real API with the requests shown on this page.

201application/json
{
  "id": 101,
  "name": "Alex Morgan",
  "email": "alex@example.com"
}

Try it

POST
Headers
Open in playground
Send the request to see a live response.

Replace a user (simulated)

PUT/api/v1/users/{id}
Simulated - not persisted

Validates a complete replacement body and returns the resulting user. The stored record is not changed.

Parameters

Parameters for Replace a user (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1

Headers

Headers for Replace a user (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Complete user representation.

Body fields for Replace a user (simulated)
FieldTypeRequiredNotes
namestringNomin length 1, max length 100
firstNamestringNomin length 1, max length 50
lastNamestringNomin length 1, max length 50
usernamestringNo
emailstring (email)Yes
ageintegerNomin 1, max 120
gender"female" | "male" | "non-binary"No
phonestringNomin length 3, max length 30

Status codes

  • 200The replaced user.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X PUT 'https://test.naimulhassan.me/api/v1/users/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "firstName": "Emily",
  "lastName": "Carter-Hayes",
  "email": "emily.hayes@example.com",
  "age": 35
}'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "firstName": "Emily",
  "lastName": "Carter-Hayes",
  "email": "emily.hayes@example.com",
  "age": 35
}

Try it

PUT
Headers
Open in playground
Send the request to see a live response.

Update a user (simulated)

PATCH/api/v1/users/{id}
Simulated - not persisted

Merges the provided fields into the existing user and returns the result. The stored record is not changed.

Parameters

Parameters for Update a user (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1

Headers

Headers for Update a user (simulated)
NameInTypeDescription
Content-TyperequiredheaderstringMust be application/json.

Request body

Any subset of user fields.

Body fields for Update a user (simulated)
FieldTypeRequiredNotes
namestringNomin length 1, max length 100
firstNamestringNomin length 1, max length 50
lastNamestringNomin length 1, max length 50
usernamestringNo
emailstring (email)No
ageintegerNomin 1, max 120
gender"female" | "male" | "non-binary"No
phonestringNomin length 3, max length 30

Status codes

  • 200The updated user.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).
  • 422The JSON body failed validation (VALIDATION_ERROR).

Request

curl -X PATCH 'https://test.naimulhassan.me/api/v1/users/1' \
  -H 'Content-Type: application/json' \
  -d '{
  "lastName": "Hayes"
}'

Example responses

Captured from the real API with the requests shown on this page.

200application/json
{
  "id": 1,
  "firstName": "Emily",
  "lastName": "Hayes",
  "username": "emilyc",
  "email": "emily.carter@example.com",
  "phone": "+1 555-0100",
  "age": 32,
  "gender": "female",
  "birthDate": "1993-02-08",
  "image": "https://test.naimulhassan.me/api/v1/images/users/1",
  "role": "admin",
  "address": {
    "street": "3335 Lakeview Terrace",
    "city": "Denver",
    "state": "Colorado",
    "postalCode": "97836",
    "country": "United States"
  },
  "company": {
    "name": "Evergreen Robotics",
    "department": "Engineering",
    "title": "DevOps Engineer"
  }
}

Try it

PATCH
Headers
Open in playground
Send the request to see a live response.

Delete a user (simulated)

DELETE/api/v1/users/{id}
Simulated - not persisted

Returns 204 No Content if the user exists. The record is not actually removed.

Parameters

Parameters for Delete a user (simulated)
NameInTypeDescription
idrequiredpathintegerNumeric user ID (positive integer).Min: 1

Status codes

  • 204Empty body.
  • 400Invalid path or query parameter (INVALID_PARAMETER / INVALID_ID).
  • 404No record exists with that ID (RESOURCE_NOT_FOUND).

Request

curl -X DELETE 'https://test.naimulhassan.me/api/v1/users/1'

Example responses

Captured from the real API with the requests shown on this page.

204no content

No response body.

Try it

DELETE
Headers

No header yet.

Open in playground
Send the request to see a live response.