Skip to main content

updateOrganization()

Updates an Organization.

Returns the updated Organization.

function updateOrganization(organizationId: string, params: { adminDeleteEnabled?: boolean; maxAllowedMemberships?: number; name?: string; privateMetadata?: OrganizationPrivateMetadata; publicMetadata?: OrganizationPublicMetadata; selfServeDirectorySyncEnabled?: boolean; selfServeSsoEnabled?: boolean; slug?: string }): Promise<Organization>
  • Name
    organizationId
    Type
    string
    Description

    The ID of the Organization to update.

  • Name
    params
    Type
    { adminDeleteEnabled?: boolean; maxAllowedMemberships?: number; name?: string; privateMetadata?: OrganizationPrivateMetadata; publicMetadata?: OrganizationPublicMetadata; selfServeDirectorySyncEnabled?: boolean; selfServeSsoEnabled?: boolean; slug?: string; }
    Description

    The parameters to update the Organization with.

  • Name
    params.adminDeleteEnabled?
    Type
    boolean
    Description

    Whether the Organization allows admins to delete users.

  • Name
    params.maxAllowedMemberships?
    Type
    number
    Description

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

  • Name
    params.name?
    Type
    string
    Description

    The name to update the Organization with.

  • Name
    params.privateMetadata?
    Type
    OrganizationPrivateMetadata
    Description

    Deprecated. Updating metadata via updateOrganization() is deprecated. Use updateOrganizationMetadata() for partial updates (deep merge) or replaceOrganizationMetadata() for full replacement.

  • Name
    params.publicMetadata?
    Type
    OrganizationPublicMetadata
    Description

    Deprecated. Updating metadata via updateOrganization() is deprecated. Use updateOrganizationMetadata() for partial updates (deep merge) or replaceOrganizationMetadata() for full replacement.

  • Name
    params.selfServeDirectorySyncEnabled?
    Type
    boolean
    Description

    -

  • Name
    params.selfServeSsoEnabled?
    Type
    boolean
    Description

    -

  • Name
    params.slug?
    Type
    string
    Description

    The slug to update the Organization with.

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 organizationId = 'org_123'
const name = 'Test Updated'

const response = await clerkClient.organizations.updateOrganization(organizationId, { name })

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint PATCH/organizations/{organization_id}. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on