āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/clerk/clerk-docs/reference/backend/organization/create-organization ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
createOrganization()'
description: Use Clerk's JS Backend SDK to create an organization.
sdk: js-backend{/* clerk/javascript file: https://github.com/clerk/javascript/blob/main/packages/backend/src/api/endpoints/OrganizationApi.ts#L109 */}
Creates an Organization.
function createOrganization(params: CreateParams): Promise<Organization>
CreateParamsName of the organization.
createdBystringThe user ID for the user creating the organization. The user will become an administrator for the organization.
slug?stringSlug of the organization.
publicMetadata?OrganizationPublicMetadataMetadata that can be read from both the Frontend API and Backend API{{ target: '_blank' }}, but can be set only from the Backend API.
privateMetadata?OrganizationPrivateMetadataMetadata that is only visible to your Backend API{{ target: '_blank' }}.
maxAllowedMemberships?numberThe maximum number of memberships allowed in the organization. Setting this value to 0 removes any limit, allowing an unlimited number of memberships.
</Properties>
const name = 'test-org'
const createdBy = 'user_123'
const response = await clerkClient.organizations.createOrganization({ name, createdBy })
This method in the SDK is a wrapper around the BAPI endpoint POST/organizations. See the BAPI reference{{ target: '_blank' }} for more information.
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā