Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

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

NameTypeDescription
organizationIdstringThe organization ID of the organization a user is being invited to.
inviterUserIdstringThe user ID of the user creating the invitation.
emailAddressstringThe email address to send the invitation to.
role'admin' | 'basic_member' | 'guest_member'The role to assign the invited user within the organization.
redirectUrl?stringThe 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.

Was this helpful?

Clerk © 2023