getOrganizationMembershipList()
Gets a list of the given user's Organization memberships. By default, the list is returned in descending order by creation date (newest first).
Returns a PaginatedResourceResponse object with a data property that contains an array of OrganizationMembership objects, and a totalCount property that indicates the total number of Organization memberships for the user.
function getOrganizationMembershipList(params: GetOrganizationMembershipListParams): Promise<PaginatedResourceResponse<OrganizationMembership[]>>- Name
userId- Type
string- Description
The ID of the user to get the list of Organization memberships for.
const userId = 'user_123'
const response = await clerkClient.users.getOrganizationMembershipList({ userId })Limit the number of results
Gets a list of a user's Organization memberships, limited to the specified number of results.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList({
userId,
// returns the first 10 memberships
limit: 10,
})Skip results
Gets a list of a user's Organization memberships, skipping the specified number of results.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList({
userId,
// skips the first 10 memberships
offset: 10,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/users/{user_id}/organization_memberships. See the BAPI reference for more information.
Feedback
Last updated on