Docs

getOrganizationInvitation()

Retrieves an OrganizationInvitation by its ID, if the ID is valid.

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_2ZUtbk2yvnFGItdeze1ivCh3uqh';

const invitationId = 'orginv_2b6QTdXZGhcNRJWcrkLPGYZRjeI';

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

console.log(response);
/*
_OrganizationInvitation {
  id: 'orginv_2b6QTdXZGhcNRJWcrkLPGYZRjeI',
  emailAddress: 'testclerk123@gmail.com',
  role: 'org:admin',
  organizationId: 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh',
  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 details.

Feedback

What did you think of this content?