getInvitationList()
Gets a list of non-revoked invitations for the instance, sorted by descending creation date. 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 Invitation objects and a totalCount property containing the total number of invitations.
function getInvitationList(params: GetInvitationListParams): Promise<PaginatedResourceResponse<Invitation[]>>- Name
orderBy?- Type
WithSign<"created_at" | "email_address" | "expires_at">- Description
Filters the invitations in a particular order. Prefix a value with
+to sort in ascending order, or-to sort in descending order. Defaults to-created_at.
- Name
query?- Type
string- Description
Filters invitations based on
email_addressorid.
- Name
status?- Type
"pending" | "accepted" | "revoked" | "expired"- Description
Filters invitations based on their status.
const response = await clerkClient.invitations.getInvitationList()Filter by invitation status
Gets a list of invitations that have been revoked.
// get all revoked invitations
const response = await clerkClient.invitations.getInvitationList({ status: 'revoked' })Limit the number of results
Gets a list of revoked invitations, limited to the specified number of results.
const { data, totalCount } = await clerkClient.invitations.getInvitationList({
status: 'revoked',
// returns the first 10 results
limit: 10,
})Skip results
Gets a list of revoked invitations, skipping the specified number of results.
const { data, totalCount } = await clerkClient.invitations.getInvitationList({
status: 'revoked',
// skips the first 10 results
offset: 10,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint GET/invitations. See the BAPI reference for more information.
Feedback
Last updated on