Resource reference
Users
People with contact, address, and company data. Users own posts and todos.
Data model
Users schema
Responses include the following fields. Read-only values are generated by the API.
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | Read only | Auto-incrementing resource identifier. |
name | string | Required | Display name, 1 to 100 characters. |
username | string | Required | Unique username, 3 to 50 letters, numbers, or underscores. |
email | email string | Required | Unique valid email address. |
phone | string | Optional | Valid phone number. |
website | URL string | Optional | Valid website URL. |
address | object | Optional | Nested street, city, zipcode, and geo data. |
company | object | Optional | Nested company name, catch phrase, and business text. |
createdAt | ISO 8601 string | Read only | Time the record was created. |
updatedAt | ISO 8601 string | Read only | Time the record was last updated. |
Example object
A complete user
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}Endpoints
Read and write users
Every example uses the shared free API. Replace :id with a numeric record ID.
GET/users
List users
Returns a paginated user collection.
curl 'https://api.apimocker.com/users'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
_page or page | integer | Optional | Page number. Defaults to 1. |
_limit or limit | integer | Optional | Items per page. Defaults to 10 and is capped at 100. |
_sort | string | Optional | Field used for sorting. Defaults to id. |
_order | asc | desc | Optional | Sort direction. Defaults to asc. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
name_like | string | Optional | Partial, case-insensitive name match. |
username | string | Optional | Exact username match. |
email | string | Optional | Exact email match. |
Example response
{
"data": [
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 10,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}GET/users/search?q=john
Search users
Searches name, username, and email and returns up to 10 matches.
curl 'https://api.apimocker.com/users/search?q=john'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Required | Case-insensitive search text. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
Example response
{
"query": "john",
"total": 1,
"results": [
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com"
}
]
}GET/users/:id
Get one user
Returns a user directly, without the list response envelope.
curl 'https://api.apimocker.com/users/1'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
_delay | integer | Optional | Artificial response delay in milliseconds. |
Example response
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}GET/users/:id/posts
List a user's posts
Returns the posts owned by a user in the standard paginated envelope.
curl 'https://api.apimocker.com/users/1/posts'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
_page or page | integer | Optional | Page number. Defaults to 1. |
_limit or limit | integer | Optional | Items per page. Defaults to 10 and is capped at 100. |
Example response
{
"data": [
{
"id": 1,
"title": "Getting Started with Modern Web Development: A Practical First Project",
"body": "This is a comprehensive article about getting started with modern web development.",
"userId": 1,
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z",
"user": {
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com"
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 10,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}GET/users/:id/todos
List a user's todos
Returns the todos owned by a user in the standard paginated envelope.
curl 'https://api.apimocker.com/users/1/todos'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
_page or page | integer | Optional | Page number. Defaults to 1. |
_limit or limit | integer | Optional | Items per page. Defaults to 10 and is capped at 100. |
Example response
{
"data": [
{
"id": 1,
"title": "Review the component architecture",
"description": "Check the loading and empty states before the next release.",
"completed": false,
"userId": 1,
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z",
"user": {
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com"
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 20,
"totalPages": 2,
"hasNext": true,
"hasPrev": false
}
}POST/users
Create a user
Creates a shared user and returns the new resource with status 201.
curl -X POST 'https://api.apimocker.com/users' \
-H 'Content-Type: application/json' \
-d '{ "name": "Jane Smith", "username": "janesmith", "email": "jane@example.com" }'Request body
{
"name": "Jane Smith",
"username": "janesmith",
"email": "jane@example.com"
}Example response
{
"id": 11,
"name": "Jane Smith",
"username": "janesmith",
"email": "jane@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}- Writes affect the shared dataset until the next daily reset.
- Unknown fields are rejected by the database layer.
PUT/users/:id
Replace a user
Updates a user. Name, username, and email are required.
curl -X PUT 'https://api.apimocker.com/users/1' \
-H 'Content-Type: application/json' \
-d '{ "name": "Jane Smith", "username": "janesmith", "email": "jane@example.com" }'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
Request body
{
"name": "Jane Smith",
"username": "janesmith",
"email": "jane@example.com"
}Example response
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}- Writes affect the shared dataset until the next daily reset.
- Unknown fields are rejected by the database layer.
PATCH/users/:id
Update selected user fields
Updates only the provided fields.
curl -X PATCH 'https://api.apimocker.com/users/1' \
-H 'Content-Type: application/json' \
-d '{ "website": "https://jane.dev" }'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
Request body
{
"website": "https://jane.dev"
}Example response
{
"id": 1,
"name": "John Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"phone": "+1-555-0123",
"website": "https://johndoe.dev",
"address": {
"street": "123 Main St",
"suite": "Apt 4B",
"city": "New York",
"zipcode": "10001",
"geo": {
"lat": "40.7128",
"lng": "-74.0060"
}
},
"company": {
"name": "Tech Solutions Inc",
"catchPhrase": "Innovating the future",
"bs": "harness real-time e-markets"
},
"createdAt": "2026-07-22T00:00:03.599Z",
"updatedAt": "2026-07-22T00:00:03.599Z"
}- Writes affect the shared dataset until the next daily reset.
- Unknown fields are rejected by the database layer.
DELETE/users/:id
Delete a user
Deletes the user and cascades to that user's posts, todos, comments, and likes.
curl -X DELETE 'https://api.apimocker.com/users/1'Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Required | The resource ID from the URL path. |
- Writes affect the shared dataset until the next daily reset.
- Unknown fields are rejected by the database layer.