createOrganizationInvitation() - Organizations | Clerk Docs

createOrganizationInvitation()

Creates an invitation for a user to join an Organization.

Returns the newly created OrganizationInvitation object.

function createOrganizationInvitation(params: CreateOrganizationInvitationParams): Promise<OrganizationInvitation>

CreateOrganizationInvitationParams

Usage

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 inviterUserId = 'user_123'
const emailAddress = 'testclerk123@clerk.dev'
const role = 'org:member'

const response = await clerkClient.organizations.createOrganizationInvitation({
  organizationId,
  inviterUserId,
  emailAddress,
  role,
})

Backend API (BAPI) endpoint

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