Users
Overview
Section titled “Overview”The Users resource provides realistic fake user data with names, emails, and timestamps.
Endpoints
Section titled “Endpoints”Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/users | List all users |
| GET | /v1/users/:id | Get a specific user |
| GET | /v1/users/:id/posts | Get user's posts |
| GET | /v1/users/:id/todos | Get user's todos |
| GET | /v1/users/:id/albums | Get user's albums |
User Object
Section titled “User Object”{ "id": 1, "firstName": "John", "lastName": "Doe", "email": "john@example.com", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z"}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
firstName |
string |
User’s first name |
lastName |
string |
User’s last name |
email |
string |
User’s email address |
createdAt |
string |
ISO 8601 timestamp |
updatedAt |
string |
ISO 8601 timestamp |
List Users
Section titled “List Users”curl https://api.phantomjson.app/v1/usersQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page |
number |
1 |
Page number |
limit |
number |
20 |
Items per page (max: 100) |
sort |
string |
— | Sort field and direction |
q |
string |
— | Search query |
fields |
string |
— | Fields to return |
firstName |
string |
— | Filter by first name |
lastName |
string |
— | Filter by last name |
email |
string |
— | Filter by email |
Response
Section titled “Response”{ "data": [ { "id": 1, "firstName": "John", "lastName": "Doe", "email": "john@example.com", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z" } ], "meta": { "total": 100, "page": 1, "limit": 20, "totalPages": 5 }}Get User by ID
Section titled “Get User by ID”curl https://api.phantomjson.app/v1/users/1Response
Section titled “Response”{ "data": { "id": 1, "firstName": "John", "lastName": "Doe", "email": "john@example.com", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z" }}Get User’s Posts
Section titled “Get User’s Posts”curl https://api.phantomjson.app/v1/users/1/postsResponse
Section titled “Response”{ "data": [ { "id": 1, "userId": 1, "title": "First Post", "body": "This is the body of the first post." } ], "meta": { "total": 5, "page": 1, "limit": 20, "totalPages": 1 }}Get User’s Todos
Section titled “Get User’s Todos”curl https://api.phantomjson.app/v1/users/1/todosResponse
Section titled “Response”{ "data": [ { "id": 1, "userId": 1, "title": "Buy groceries", "completed": false } ], "meta": { "total": 3, "page": 1, "limit": 20, "totalPages": 1 }}Get User’s Albums
Section titled “Get User’s Albums”curl https://api.phantomjson.app/v1/users/1/albumsResponse
Section titled “Response”{ "data": [ { "id": 1, "userId": 1, "title": "Vacation Photos" } ], "meta": { "total": 2, "page": 1, "limit": 20, "totalPages": 1 }}Examples
Section titled “Examples”Search Users
Section titled “Search Users”curl "https://api.phantomjson.app/v1/users?q=john"Filter by First Name
Section titled “Filter by First Name”curl "https://api.phantomjson.app/v1/users?firstName=John"Sort by Name
Section titled “Sort by Name”curl "https://api.phantomjson.app/v1/users?sort=firstName:asc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/users?fields=id,firstName,email"Combined Query
Section titled “Combined Query”curl "https://api.phantomjson.app/v1/users?q=john&sort=firstName:asc&fields=id,firstName,email&limit=10"