import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const memberListResponse of client.members.list()) {
console.log(memberListResponse.id);
}{
"data": [
{
"id": "<string>",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"joined_at": "2023-12-01T05:00:00.401Z",
"access_level": "no_access",
"status": "drafted",
"most_recent_action": "canceling",
"most_recent_action_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "<string>",
"email": "<string>",
"name": "<string>",
"username": "<string>"
},
"phone": "<string>",
"usd_total_spent": 6.9,
"company_token_balance": 6.9
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}Returns a paginated list of members for a company, with extensive filtering by product, plan, status, access level, and more.
Required permissions:
member:basic:readmember:email:readmember:phone:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const memberListResponse of client.members.list()) {
console.log(memberListResponse.id);
}{
"data": [
{
"id": "<string>",
"created_at": "2023-12-01T05:00:00.401Z",
"updated_at": "2023-12-01T05:00:00.401Z",
"joined_at": "2023-12-01T05:00:00.401Z",
"access_level": "no_access",
"status": "drafted",
"most_recent_action": "canceling",
"most_recent_action_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "<string>",
"email": "<string>",
"name": "<string>",
"username": "<string>"
},
"phone": "<string>",
"usd_total_spent": 6.9,
"company_token_balance": 6.9
}
],
"page_info": {
"end_cursor": "<string>",
"start_cursor": "<string>",
"has_next_page": true,
"has_previous_page": true
}
}A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************
Returns the elements in the list that come after the specified cursor.
Returns the elements in the list that come before the specified cursor.
Returns the first n elements from the list.
42
Returns the last n elements from the list.
42
The unique identifier of the company to list members for.
"biz_xxxxxxxxxxxxxx"
The sort direction for results. Defaults to descending.
asc, desc The column to sort members by, such as creation date or revenue.
id, usd_total_spent, created_at, joined_at, most_recent_action Only return members created before this timestamp.
"2023-12-01T05:00:00.401Z"
Only return members created after this timestamp.
"2023-12-01T05:00:00.401Z"
Filter members by their current access level to the product.
no_access, admin, customer Filter members to only those belonging to these specific products.
Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.
Filter members to only those subscribed to these specific plans.
Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.
Filter members to only those matching these specific user identifiers.
Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.
Filter members by their current subscription status.
The different statuses a Member can have.
drafted, joined, left Filter members to only those who used these specific promo codes.
Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.
Filter members by their most recent activity type.
The different most recent actions a member can have.
canceling, churned, finished_split_pay, paused, paid_subscriber, paid_once, expiring, joined, drafted, left, trialing, pending_entry, renewing, past_due Search members by name, username, or email. Email filtering requires the member:email:read permission.
Was this page helpful?