createOrganizationInvitation()
Creates an invitation for new users to join an organization.
const name = 'my-organization-name'; const inviterUserId = 'my-user-id'; const emailAddress = 'user-email-address'; const role = 'role-to-assign-user'; const organization = await clerkClient.organizations.createOrganizationInvitation({name, inviterUserId, emailAddress, role});
CreateOrganizationInvitationParams
Name | Type | Description |
---|---|---|
organizationId | string | The organization ID of the organization a user is being invited to. |
inviterUserId | string | The user ID of the user creating the invitation. |
emailAddress | string | The email address to send the invitation to. |
role | string | The role to assign the invited user within the organization. |
redirectUrl? | string | The URL users will land at once the organization invitation has been accepted. |
publicMetadata? | Record<string, unknown> | Metadata saved on the invitation that is visible to both your Frontend and Backend APIs. |