getOrganizationInvitationList()
Gets a list of the given user's Organization invitations. 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 OrganizationInvitation objects, and a totalCount property that indicates the total number of Organization invitations for the user.
function getOrganizationInvitationList(params: GetOrganizationInvitationListParams): Promise<PaginatedResourceResponse<OrganizationInvitation[]>>- Name
status?- Type
"pending" | "accepted" | "revoked" | "expired"- Description
Filters the invitations by the provided status.
- Name
userId- Type
string- Description
The ID of the user to get the list of Organization invitations for.
const userId = 'user_123'
const response = await clerkClient.users.getOrganizationInvitationList({ userId })Filter by invitation status
Gets a list of a user's Organization invitations filtered by invitation status.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList({
userId,
// returns a list of invitations that have not yet been accepted
status: ['pending'],
})Limit the number of results
Gets a list of a user's Organization invitations, limited to the specified number of results.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList({
userId,
// returns the first 10 invitations
limit: 10,
})Skip results
Gets a list of a user's Organization invitations, skipping the specified number of results.
const userId = 'user_123'
const { data, totalCount } = await clerkClient.users.getOrganizationInvitationList({
userId,
// skips the first 10 invitations
offset: 10,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/users/{user_id}/organization_invitations. See the BAPI reference for more information.
Feedback
Last updated on