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.

GET /users

Retrieve a paginated list of users. Results merge shared global user records with session sandbox overlays (newly created users appear at the top).

Request Parameters
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"

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
GET /users/:id

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.

Request Parameters
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"

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
POST /users

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.

Request Parameters
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"
  }
}'

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
PUT /users/:id

Replace an existing user record in the session overlay. Global records remain untouched for other visitors and preserve original list position.

Request Parameters
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"
}'

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
PATCH /users/:id

Partially update specific fields of a user record in the session overlay.

Request Parameters
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"
}'

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
DELETE /users/:id

Remove a user record from the requesting session view. The underlying global record is unaffected for other visitors.

Request Parameters
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"

Response Schema Example

204 No Content
⚡ Try it out — Test endpoint live Run fetch