Users Resource Documentation
Read operations merge shared global users data with your session's overlay (creates appear at the top, deletes are removed, updates preserve position). All mutations are session-scoped via an HTTP cookie and never affect shared global data or other visitors.
Retrieve a paginated list of users. Results merge shared global user records with session sandbox overlays (newly created users appear at the top).
| Name | Type | Location | Description |
|---|---|---|---|
page |
integer |
query | Page number (1-indexed, default 1). |
limit |
integer |
query | Number of records per page (default 10, max 30). |
curl -X GET 'http://localhost:3000/users' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid"
fetch('http://localhost:3000/users', {
method: 'GET',
credentials: 'include'
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.get('http://localhost:3000/users', {
withCredentials: true
}).then(response => console.log(response.data));
import requests
response = requests.get('http://localhost:3000/users')
print(response.json())
Response Schema Example
{
"data": [
{
"id": "local-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"_sandbox": "created"
},
{
"id": 1,
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "hildegard.org",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
}
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 26,
"totalPages": 3,
"hasNextPage": true,
"hasPrevPage": false
}
}
⚡ Try it out — Test endpoint live Run fetch
Retrieve a single user by ID. Supports plain integer IDs for global records (e.g. 1) and string IDs formatted as local-<uuid> for session sandbox records.
| Name | Type | Location | Description |
|---|---|---|---|
id |
string | integer |
path | User ID (e.g. 1 for global user or local-<uuid> for sandbox user). |
curl -X GET 'http://localhost:3000/users/:id' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid"
fetch('http://localhost:3000/users/:id', {
method: 'GET',
credentials: 'include'
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.get('http://localhost:3000/users/:id', {
withCredentials: true
}).then(response => console.log(response.data));
import requests
response = requests.get('http://localhost:3000/users/:id')
print(response.json())
Response Schema Example
{
"id": 1,
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "hildegard.org",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
}
}
⚡ Try it out — Test endpoint live Run fetch
Create a new session sandbox user record. Returns a local-<uuid> formatted ID with _sandbox: 'created'. Each session identity is capped at 30 created records.
| Name | Type | Location | Description |
|---|---|---|---|
name |
string |
body | Full name of the user. |
username |
string |
body | Username. |
email |
string |
body | Email address. |
phone |
string |
body | Phone number. |
website |
string |
body | Website URL. |
address |
object |
body | JSON object containing street, city, zipcode. |
company |
object |
body | JSON object containing company name and catchPhrase. |
curl -X POST 'http://localhost:3000/users' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid" \
-d '{
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "hildegard.org",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
}
}'
fetch('http://localhost:3000/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ "name": "Leanne Graham", "username": "bret", "email": "sincere@april.biz", "phone": "+1-770-555-0123", "website": "hildegard.org", "address": { "street": "Kulas Light", "city": "Gwenborough", "zipcode": "92998-3874" }, "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net" } })
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.post('http://localhost:3000/users', { "name": "Leanne Graham", "username": "bret", "email": "sincere@april.biz", "phone": "+1-770-555-0123", "website": "hildegard.org", "address": { "street": "Kulas Light", "city": "Gwenborough", "zipcode": "92998-3874" }, "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net" } }, {
withCredentials: true
}).then(response => console.log(response.data));
import requests
payload = { "name": "Leanne Graham", "username": "bret", "email": "sincere@april.biz", "phone": "+1-770-555-0123", "website": "hildegard.org", "address": { "street": "Kulas Light", "city": "Gwenborough", "zipcode": "92998-3874" }, "company": { "name": "Romaguera-Crona", "catchPhrase": "Multi-layered client-server neural-net" } }
response = requests.post('http://localhost:3000/users', json=payload)
print(response.json())
Request Payload Example
{
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "hildegard.org",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
}
}
Response Schema Example
{
"id": "local-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Leanne Graham",
"username": "bret",
"email": "sincere@april.biz",
"_sandbox": "created"
}
⚡ Try it out — Test endpoint live Run fetch
Replace an existing user record in the session overlay. Global records remain untouched for other visitors and preserve original list position.
| Name | Type | Location | Description |
|---|---|---|---|
id |
string | integer |
path | User ID to update (e.g. 1 or local-<uuid>). |
curl -X PUT 'http://localhost:3000/users/:id' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid" \
-d '{
"name": "Leanne Graham (Updated)",
"username": "bret",
"email": "sincere@april.biz",
"website": "https://updated-user.dev"
}'
fetch('http://localhost:3000/users/:id', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ "name": "Leanne Graham (Updated)", "username": "bret", "email": "sincere@april.biz", "website": "https://updated-user.dev" })
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.put('http://localhost:3000/users/:id', { "name": "Leanne Graham (Updated)", "username": "bret", "email": "sincere@april.biz", "website": "https://updated-user.dev" }, {
withCredentials: true
}).then(response => console.log(response.data));
import requests
payload = { "name": "Leanne Graham (Updated)", "username": "bret", "email": "sincere@april.biz", "website": "https://updated-user.dev" }
response = requests.put('http://localhost:3000/users/:id', json=payload)
print(response.json())
Request Payload Example
{
"name": "Leanne Graham (Updated)",
"username": "bret",
"email": "sincere@april.biz",
"website": "https://updated-user.dev"
}
Response Schema Example
{
"id": 1,
"name": "Leanne Graham (Updated)",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "https://updated-user.dev",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
},
"_sandbox": "updated"
}
⚡ Try it out — Test endpoint live Run fetch
Partially update specific fields of a user record in the session overlay.
| Name | Type | Location | Description |
|---|---|---|---|
id |
string | integer |
path | User ID to patch (e.g. 1 or local-<uuid>). |
curl -X PATCH 'http://localhost:3000/users/:id' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid" \
-d '{
"name": "Leanne Graham (Updated)",
"website": "https://updated-user.dev"
}'
fetch('http://localhost:3000/users/:id', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({ "name": "Leanne Graham (Updated)", "website": "https://updated-user.dev" })
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.patch('http://localhost:3000/users/:id', { "name": "Leanne Graham (Updated)", "website": "https://updated-user.dev" }, {
withCredentials: true
}).then(response => console.log(response.data));
import requests
payload = { "name": "Leanne Graham (Updated)", "website": "https://updated-user.dev" }
response = requests.patch('http://localhost:3000/users/:id', json=payload)
print(response.json())
Request Payload Example
{
"name": "Leanne Graham (Updated)",
"website": "https://updated-user.dev"
}
Response Schema Example
{
"id": 1,
"name": "Leanne Graham (Updated)",
"username": "bret",
"email": "sincere@april.biz",
"phone": "+1-770-555-0123",
"website": "https://updated-user.dev",
"address": {
"street": "Kulas Light",
"city": "Gwenborough",
"zipcode": "92998-3874"
},
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net"
},
"_sandbox": "updated"
}
⚡ Try it out — Test endpoint live Run fetch
Remove a user record from the requesting session view. The underlying global record is unaffected for other visitors.
| Name | Type | Location | Description |
|---|---|---|---|
id |
string | integer |
path | User ID to delete (e.g. 1 or local-<uuid>). |
curl -X DELETE 'http://localhost:3000/users/:id' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid"
fetch('http://localhost:3000/users/:id', {
method: 'DELETE',
credentials: 'include'
})
.then(res => res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.delete('http://localhost:3000/users/:id', {
withCredentials: true
}).then(response => console.log(response.data));
import requests
response = requests.delete('http://localhost:3000/users/:id')
print(response.status_code)
Response Schema Example
204 No Content