Docs

updateOrganization()

Updates an Organization given a valid organization ID.

function updateOrganization: (params: UpdateOrganizationParams) => Promise<Organization>;
  • Name
    organizationId
    Type
    string
    Description

    The organization ID of the organization being updated.

  • Name
    name?
    Type
    string
    Description

    The updated name of the organization.

  • Name
    slug?
    Type
    string
    Description

    The updated slug of the organization.

  • Name
    publicMetadata?
    Type
    Record<string, unknown>
    Description

    Metadata saved on the organization, that is visible to both your Frontend and Backend APIs.

  • Name
    privateMetadata?
    Type
    Record<string, unknown>
    Description

    Metadata saved on the organization that is only visible to your Backend API.

updateOrganization() example

In this example, the name of the organization is updated.

const organizationId = 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh';

const name = 'Test Updated';

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

console.log(response);
/*
_Organization {
  id: 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh',
  name: 'Test Updated',
  slug: 'test',
  imageUrl: 'https://img.clerk.com/eyJ0eXBlIjoiZGVmYXVsdCIsImlpZCI6Imluc18yVjdKRFdyclJwRmZFZTlqQUM2dWpSMG8xSlQiLCJyaWQiOiJvcmdfMlpVdGJrMnl2bkZHSXRkZXplMWl2Q2gzdXFoIiwiaW5pdGlhbHMiOiJUIn0',
  hasImage: false,
  createdBy: 'user_2V7JJKmoA9HqzHhfMqK5cpgLl56',
  createdAt: 1702488558853,
  updatedAt: 1705536790529,
  publicMetadata: { example: 'metadata' },
  privateMetadata: {},
  maxAllowedMemberships: 3,
  adminDeleteEnabled: true,
  members_count: undefined
}
*/

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 details.

Feedback

What did you think of this content?