Docs

getOrganizationInvitation()

Retrieves an OrganizationInvitation.

function getOrganizationInvitation(
  params: GetOrganizationInvitationParams,
): Promise<OrganizationInvitation>
  • Name
    organizationId
    Type
    string
    Description

    The ID of the organization that the invitation is for.

  • Name
    invitationId
    Type
    string
    Description

    The ID of the invitation to retrieve.

const organizationId = 'org_123'

const invitationId = 'orginv_123'

const response = await clerkClient.organizations.getOrganizationInvitation({
  organizationId,
  invitationId,
})

console.log(response)
/*
_OrganizationInvitation {
  id: 'orginv_123',
  emailAddress: 'testclerk123@gmail.com',
  role: 'org:admin',
  organizationId: 'org_123',
  createdAt: 1705533057154,
  updatedAt: 1705534258644,
  status: 'accepted',
  publicMetadata: {},
  privateMetadata: {}
}
*/

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on