List Users

Retrieves all active shop users. This endpoint returns only users with active: true, making it suitable for populating assignment dropdowns and operator selection lists in the UI. Inactive (deactivated) users are excluded from the response.

The returned array is not paginated — all active users are returned in a single response. For most shop floor deployments, the user count is small enough (tens to low hundreds) that pagination is unnecessary.

Request

No request body or query parameters.

Response

200 OK

Returns an array of ShopUser objects. May be empty if no active users exist.

FieldTypeDescription
idstringUnique user identifier (e.g. "user_abc123")
namestringDisplay name of the user
departmentstring | undefinedDepartment the user belongs to, if set
activebooleanAlways true in this response (inactive users are filtered out)
createdAtstringISO 8601 timestamp of when the user was created

500 Internal Server Error

ConditionMessage
Database read failure"Internal Server Error"

Examples

Request

curl http://localhost:3000/api/users

Response — Multiple users

[
  {
    "id": "user_a1b2c3",
    "name": "Jane Smith",
    "department": "Assembly",
    "active": true,
    "createdAt": "2024-01-10T08:00:00.000Z"
  },
  {
    "id": "user_d4e5f6",
    "name": "John Doe",
    "department": "Quality Control",
    "active": true,
    "createdAt": "2024-01-10T08:30:00.000Z"
  },
  {
    "id": "user_g7h8i9",
    "name": "Maria Garcia",
    "active": true,
    "createdAt": "2024-01-12T09:00:00.000Z"
  }
]

Response — No active users

[]

Notes

  • This endpoint calls userService.listActiveUsers(), which filters by active: true at the repository level. Deactivated users are never included.
  • The department field is optional. Users created without a department will not have this field in the response (it will be undefined, omitted from JSON serialization).
  • There is no sorting guarantee on the returned array. The order depends on the database insertion order.
  • For a complete list including inactive users, there is no public API endpoint — this is by design to keep the operator-facing UI clean.