Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerkstage.dev

createOrganization()

Creates an organization.

const name = 'my-organization-name'; const createdBy = 'my-user-id'; const organization = await clerkClient.organizations.createOrganization({name, createdBy});

CreateParams

NameTypeDescription
namestringName of the organization.
slug?stringSlug of the organization.
createdBystringThe user ID for the user creating the organization. The user will become an administrator for the organization.
publicMetadata?Record<string, unknown>Metadata saved on the organization, that is visible to both your Frontend and Backend APIs.
privateMetadata?Record<string, unknown>Metadata saved on the organization that is only visible to your Backend API.

What did you think of this content?

Clerk © 2024