āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/clerk/clerk-docs/reference/backend/user/get-organization-membership-list ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
getOrganizationMembershipList()'
description: Use Clerk's JS Backend SDK to retrieve a list of organization memberships for a given user.
sdk: js-backend{/* clerk/javascript file: https://github.com/clerk/javascript/blob/main/packages/backend/src/api/endpoints/UserApi.ts#L214 */}
Retrieves a list of organization memberships for a given user. 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 in the system for the specified organization.
function getOrganizationMembershipList(
params: GetOrganizationMembershipListParams,
): Promise<PaginatedResourceResponse<OrganizationMembership[]>>
GetOrganizationMembershipListParamsThe ID of the user to retrieve the list of organization memberships for.
limit?numberThe number of results to return. Must be an integer greater than zero and less than 501. Can be used for paginating the results together with offset. Defaults to 10.
offset?numberSkip the first offset results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with limit. Defaults to 0.
</Properties>
const userId = 'user_123'
const response = await clerkClient.users.getOrganizationMembershipList({ userId })
Retrieves a list of a user's organization memberships that is filtered by the number of results.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList({
userId,
// returns the first 10 memberships
limit: 10,
})
Retrieves a list of a user's organization memberships that is filtered by the number of results to skip.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationMembershipList({
userId,
// skips the first 10 memberships
offset: 10,
})
This method in the SDK is a wrapper around the BAPI endpoint GET/users/{user_id}/organization_memberships. See the BAPI reference{{ target: '_blank' }} for more information.
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā