createOrganizationDomain()
Creates a new Verified Domain for the given Organization. By default, the domain is verified, but can be optionally set to unverified.
Returns the newly created OrganizationDomain object.
function createOrganizationDomain(params: CreateOrganizationDomainParams): Promise<OrganizationDomain>- Name
-
enrollmentMode - Type
"manual_invitation" | "automatic_invitation" | "automatic_suggestion" | "enterprise_sso"- Description
The enrollment mode that determines how matching users are added to the Organization.
manual_invitation: No automatic enrollment. Users with a matching email domain are not given any invitation or suggestion; an admin must invite them manually.automatic_invitation: Users with a matching email domain automatically receive a pending invitation (assigned the Organization's default role) which they can accept to join.automatic_suggestion: Users with a matching email domain automatically receive a suggestion to join, which they can request.
const organizationId = 'org_123'
const domainName = 'example.com'
const enrollmentMode = 'automatic_invitation'
const response = await clerkClient.organizations.createOrganizationDomain({
organizationId,
domainName,
enrollmentMode,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint POST/organizations/{organization_id}/domains. See the BAPI reference for more information.
Feedback
Last updated on