listUsers()
listUsers(
options?:ListUsersOptions):Promise<ListUsersResponse>
Defined in: packages/core/src/index.ts:445
List all users with pagination and filters (admin only)
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ListUsersOptions | Pagination and filter options (page, limit, search, status) |
Returns
Promise<ListUsersResponse>
Paginated list of users with total count
Throws
401 - Not authenticated
Throws
403 - Admin privileges required
Example
import { listUsers } from "@cpod/sdk";
// Basic pagination
const users = await listUsers({ page: 1, limit: 20 });
console.log(`Total users: ${users.total}`);
// With search and status filter
const activeUsers = await listUsers({
page: 1,
limit: 10,
search: "john",
status: "active",
});