Display an application’s users
Administrative user directory
Clerk · Module
Lists users in the current Clerk instance with optional filters, ordering, and pagination. The response contains matching User objects plus the instance-wide total count.
Call this server-side Clerk client method with optional filters, sorting, and pagination settings. It returns a paginated response whose data array contains User objects and whose totalCount reports the instance-wide user count.
function getUserList(params: UserListParams): Promise<PaginatedResourceResponse<User[]>>| Name | Type | Description |
|---|---|---|
params | UserListParams | Optional filtering, ordering, and pagination settings, including emailAddress, createdAtAfter, createdAtBefore, lastSignInAtAfter, lastSignInAtBefore, limit, offset, and orderBy. |
Promise<PaginatedResourceResponse<User[]>>
import { clerkClient } from '@clerk/nextjs/server'
const client = await clerkClient()
const { data, totalCount } = await client.users.getUserList({
orderBy: '-created_at',
limit: 10,
})
console.log({ users: data, totalCount })Creates the server-side Clerk client, retrieves up to 10 newest users, and logs the returned users and total count.
Administrative user directory
Moderation or support tooling
Reporting and lifecycle analysis
It returns a Promise resolving to a PaginatedResourceResponse<User[]>. The response exposes the matching users through data and the instance user count through totalCount.
Follow-up: How would you retrieve the newest 25 users? Pass orderBy: '-created_at' and limit: 25 in the parameter object.
With no ordering argument, users are returned newest first by creation date. The documented default ordering is -created_at.
Follow-up: How would you request oldest-first ordering? Use orderBy: '+created_at'.
Use filters such as emailAddress, createdAtAfter, createdAtBefore, lastSignInAtAfter, and lastSignInAtBefore in UserListParams. limit controls page size, while offset works with limit for pagination.
Follow-up: How can you constrain a query to a sign-in interval? Supply the after and before Unix timestamps through lastSignInAtAfter and lastSignInAtBefore.
UserListParamsPaginatedResourceResponseUserclerkClientGET /users