getOrganizationMembershipList()
Gets the list of Organization memberships for the specified Organization. By default, the list is returned in descending order by creation date (newest first).
Returns a PaginatedResourceResponse object with a data property containing an array of OrganizationMembership objects and a totalCount property containing the total number of Organization memberships for the Organization.
function getOrganizationMembershipList(params: GetOrganizationMembershipListParams): Promise<PaginatedResourceResponse<OrganizationMembership[]>>- Name
createdAtAfter?- Type
number- Description
Filters Organization memberships by creation date after the given date (with millisecond precision). For example, use
1730160000000to get users who have been created after 2024-10-29.
- Name
createdAtBefore?- Type
number- Description
Filters Organization memberships by creation date before the given date (with millisecond precision). For example, use
1730160000000to get users who have been created before 2024-10-29.
- Name
emailAddress?- Type
string[]- Description
Filters Organization memberships by email address. Accepts up to 100 email addresses.
- Name
emailAddressQuery?- Type
string- Description
Filters Organization memberships by email address. Accepts up to 100 email addresses. Partial matches supported. For example,
emailAddressQuery=ellowill match a user with the emailHELLO@example.com.
- Name
lastActiveAtAfter?- Type
number- Description
Filters Organization memberships by last session activity after the given date (with millisecond precision). For example, use
1700690400000to get users whose last session activity was after 2023-11-23.
- Name
lastActiveAtBefore?- Type
number- Description
Filters Organization memberships by last session activity before the given date (with millisecond precision). For example, use
1700690400000to get users whose last session activity was before 2023-11-23.
- Name
nameQuery?- Type
string- Description
Filters Organization memberships by name. Accepts up to 100 names. Partial matches supported. For example,
nameQuery=John Doewill match a user with the nameJohn Doe.
- Name
orderBy?- Type
WithSign<"phone_number" | "email_address" | "created_at" | "first_name" | "last_name" | "username">- Description
Filters Organization memberships in a particular order. Prefix a value with
+to sort in ascending order, or-to sort in descending order. Defaults to-created_at.
- Name
organizationId- Type
string- Description
The ID of the Organization to get the list of memberships for.
- Name
phoneNumber?- Type
string[]- Description
Filters Organization memberships by phone number. Accepts up to 100 phone numbers.
- Name
phoneNumberQuery?- Type
string- Description
Filters Organization memberships by phone number. Accepts up to 100 phone numbers. Partial matches supported. For example,
phoneNumberQuery=555will match a user with the phone number+1555xxxxxxx.
- Name
query?- Type
string- Description
Filters Organization memberships matching the given query across email addresses, phone numbers, usernames, Web3 wallet addresses, user IDs, first names, and last names. Partial matches supported. For example,
query=hellowill match a user with the emailHELLO@example.com.
- Name
role?- Type
OrganizationCustomRoleKey[]- Description
Filters Organization memberships by Role. Accepts up to 100 Roles.
- Name
userId?- Type
string[]- Description
Filters Organization memberships by user ID. Accepts up to 100 user IDs.
- Name
username?- Type
string[]- Description
Filters Organization memberships by username. Accepts up to 100 usernames.
- Name
usernameQuery?- Type
string- Description
Filters Organization memberships by username. Accepts up to 100 usernames. Partial matches supported. For example,
usernameQuery=CoolUserwill match a user with the usernameSomeCoolUser.
- Name
web3Wallet?- Type
string[]- Description
Filters Organization memberships by web3 wallet address. Accepts up to 100 web3 wallet addresses.
const organizationId = 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh'
const response = await clerkClient.organizations.getOrganizationMembershipList({ organizationId })getOrganizationMembershipList({ organizationId, limit })
Gets a list of Organization memberships, limited to the specified number of results.
const organizationId = 'org_123'
const { data, totalCount } = await clerkClient.organizations.getOrganizationMembershipList({
organizationId,
// returns the first 10 memberships
limit: 10,
})getOrganizationMembershipList({ organizationId, offset })
Gets a list of Organization memberships, skipping the specified number of results.
const organizationId = 'org_123'
const { data, totalCount } = await clerkClient.organizations.getOrganizationMembershipList({
organizationId,
// skips the first 10 memberships
offset: 10,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/organizations/{organization_id}/memberships. See the BAPI reference for more information.
Feedback
Last updated on