Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

createOrganizationInvitation()

Creates an invitation for new users to join an organization.

const organizationId = 'my-organization-id'; const inviterUserId = 'my-user-id'; const emailAddress = 'user-email-address'; const role = 'role-to-assign-user'; const organization = await clerkClient.organizations.createOrganizationInvitation({organizationId, 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.
rolestringThe 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.

Last updated on January 12, 2024

What did you think of this content?

Clerk © 2024