Resources
Users
Writes are simulated
POST, PUT, PATCH, and DELETE validate your input and return realistic responses, but the shared dataset is never modified.
Endpoints
- GET
/usersList users - GET
/users/searchSearch users - GET
/users/{id}Get a user - GET
/users/{id}/postsList a user's posts - GET
/users/{id}/todosList a user's todos - GET
/users/{id}/cartsList a user's carts - POST
/usersCreate a user (simulated) - PUT
/users/{id}Replace a user (simulated) - PATCH
/users/{id}Update a user (simulated) - DELETE
/users/{id}Delete a user (simulated)
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.
| Field | Type | Notes |
|---|---|---|
id | integer | min -9007199254740991, max 9007199254740991 |
firstName | string | |
lastName | string | |
username | string | |
email | string | |
phone | string | |
age | integer | min -9007199254740991, max 9007199254740991 |
gender | "female" | "male" | "non-binary" | |
birthDate | string | |
image | string | |
role | "admin" | "moderator" | "user" | |
address | object | |
address.street | string | |
address.city | string | |
address.state | string | |
address.postalCode | string | |
address.country | string | |
company | object | |
company.name | string | |
company.department | string | |
company.title | string |
List users
/api/v1/usersReturns a paginated list of users. Supports pagination, field selection, sorting, and filtering.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company. |
sortBy | query | string | Field to sort by.One of: id, firstName, lastName, username, age, birthDateDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
role | query | string | Filter by role.One of: admin, moderator, user |
gender | query | string | Filter by gender.One of: female, male, non-binary |
city | query | string | Filter by city (case-insensitive exact match). |
minAge | query | integer | Minimum age (inclusive). |
maxAge | query | integer | Maximum age (inclusive). |
delay | query | integer | Delay 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, andlimitmetadata. - 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.
{
"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
Search users
/api/v1/users/searchCase-insensitive search across firstName, lastName, username, email. Returns an empty users array with total: 0 when nothing matches.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
qrequired | query | string | Search term (1-100 characters). |
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company. |
sortBy | query | string | Field to sort by.One of: id, firstName, lastName, username, age, birthDateDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
delay | query | integer | Delay 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
qparameter (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.
{
"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 a user
/api/v1/users/{id}Returns a single user by its numeric ID.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, firstName, lastName, username, email, phone, age, gender, birthDate, image, role, address, company. |
delay | query | integer | Delay 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.
{
"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
List a user's posts
/api/v1/users/{id}/postsReturns posts whose userId matches the user ID. Returns 404 if the user does not exist.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, title, body, userId, tags, reactions, views. |
sortBy | query | string | Field to sort by.One of: id, title, views, userIdDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
delay | query | integer | Delay 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.
{
"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
List a user's todos
/api/v1/users/{id}/todosReturns todos whose userId matches the user ID. Returns 404 if the user does not exist.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, todo, completed, userId. |
sortBy | query | string | Field to sort by.One of: id, todo, userIdDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
delay | query | integer | Delay 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.
{
"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
List a user's carts
/api/v1/users/{id}/cartsReturns carts whose userId matches the user ID. Returns 404 if the user does not exist.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
limit | query | integer | Number of records to return (1-100).Default: 30Range: 1-100 |
skip | query | integer | Number of records to skip before returning results.Default: 0Range: 0-1000000 |
select | query | string | Comma-separated list of fields to return. id is always included. Allowed: id, userId, products, total, discountedTotal, totalProducts, totalQuantity. |
sortBy | query | string | Field to sort by.One of: id, userId, total, discountedTotal, totalQuantityDefault: id |
order | query | string | Sort direction.One of: asc, descDefault: asc |
delay | query | integer | Delay 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.
{
"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
Create a user (simulated)
/api/v1/usersValidates 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
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Users fields.
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | min length 1, max length 100 |
firstName | string | No | min length 1, max length 50 |
lastName | string | No | min length 1, max length 50 |
username | string | No | |
email | string (email) | Yes | |
age | integer | No | min 1, max 120 |
gender | "female" | "male" | "non-binary" | No | |
phone | string | No | min 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.
{
"id": 101,
"name": "Alex Morgan",
"email": "alex@example.com"
}Try it
Replace a user (simulated)
/api/v1/users/{id}Validates a complete replacement body and returns the resulting user. The stored record is not changed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
Headers
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Complete user representation.
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | min length 1, max length 100 |
firstName | string | No | min length 1, max length 50 |
lastName | string | No | min length 1, max length 50 |
username | string | No | |
email | string (email) | Yes | |
age | integer | No | min 1, max 120 |
gender | "female" | "male" | "non-binary" | No | |
phone | string | No | min 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.
{
"id": 1,
"firstName": "Emily",
"lastName": "Carter-Hayes",
"email": "emily.hayes@example.com",
"age": 35
}Try it
Update a user (simulated)
/api/v1/users/{id}Merges the provided fields into the existing user and returns the result. The stored record is not changed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric user ID (positive integer).Min: 1 |
Headers
| Name | In | Type | Description |
|---|---|---|---|
Content-Typerequired | header | string | Must be application/json. |
Request body
Any subset of user fields.
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | No | min length 1, max length 100 |
firstName | string | No | min length 1, max length 50 |
lastName | string | No | min length 1, max length 50 |
username | string | No | |
email | string (email) | No | |
age | integer | No | min 1, max 120 |
gender | "female" | "male" | "non-binary" | No | |
phone | string | No | min 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.
{
"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
Delete a user (simulated)
/api/v1/users/{id}Returns 204 No Content if the user exists. The record is not actually removed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | integer | Numeric 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.
No response body.