Skip to main content

createOrganization()

Creates an Organization.

function createOrganization(params: CreateParams): Promise<Organization>
  • Name
    createdBy?
    Type
    string
    Description

    The ID of the user creating the Organization. The user will become an admin for the Organization.

  • Name
    maxAllowedMemberships?
    Type
    number
    Description

    The maximum number of memberships allowed in the Organization. 0 means unlimited.

  • Name
    name
    Type
    string
    Description

    The name of the Organization.

  • Name
    privateMetadata?
    Type
    OrganizationPrivateMetadata
    Description

    Metadata that can be read and set only from the Backend API.

  • Name
    publicMetadata?
    Type
    OrganizationPublicMetadata
    Description

    Metadata that can be read from the Frontend API and Backend API, but can be set only from the Backend API.

  • Name
    slug?
    Type
    string
    Description

    The slug of the Organization.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const name = 'test-org'
const createdBy = 'user_123'
const response = await clerkClient.organizations.createOrganization({ name, createdBy })

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/organizations. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on