Skip to main content

getOrganizationInvitationList()

Gets the list of Organization invitations for the specified Organization.

Returns a PaginatedResourceResponse object with a data property containing an array of OrganizationInvitation objects and a totalCount property containing the total number of Organization invitations for the Organization.

function getOrganizationInvitationList(params: GetOrganizationInvitationListParams): Promise<PaginatedResourceResponse<OrganizationInvitation[]>>
  • Name
    limit?
    Type
    number
    Description

    Maximum number of items returned per request. Must be an integer greater than zero and less than 501. Can be used for paginating the results together with offset. Defaults to 10.

  • Name
    offset?
    Type
    number
    Description

    Skip the first offset items when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with limit. Defaults to 0.

  • Name
    organizationId
    Type
    string
    Description

    The ID of the Organization to get the list of invitations for.

  • Name
    status?
    Type
    ("pending" | "accepted" | "revoked" | "expired")[]
    Description

    Filters Organization invitations by status. Accepts up to 100 statuses.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const organizationId = 'org_123'

const response = await clerkClient.organizations.getOrganizationInvitationList({ organizationId })

Filter by invitation status

Gets a list of Organization invitations filtered by invitation status.

const organizationId = 'org_123'

const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({
  organizationId,
  // returns a list of invitations that have not yet been accepted
  status: ['pending'],
})

Limit the number of results

Gets a list of Organization invitations, limited to the specified number of results.

const organizationId = 'org_123'

const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({
  organizationId,
  // returns the first 10 results
  limit: 10,
})

Skip results

Gets a list of Organization invitations, skipping the specified number of results.

const organizationId = 'org_123'

const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({
  organizationId,
  // skips the first 10 results
  offset: 10,
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint GET/organizations/{organization_id}/invitations. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on