updateOrganizationMetadata()
Updates the metadata for the given Organization, by merging existing values with the provided parameters.
A "deep" merge will be performed - "deep" means that any nested JSON objects will be merged as well. You can remove metadata keys at any level by setting their value to null.
Returns the updated Organization.
function updateOrganizationMetadata(organizationId: string, params: { privateMetadata?: OrganizationPrivateMetadata; publicMetadata?: OrganizationPublicMetadata }): Promise<Organization>- Name
organizationId- Type
string- Description
The ID of the Organization to update the metadata for.
- Name
params- Type
{ privateMetadata?: OrganizationPrivateMetadata; publicMetadata?: OrganizationPublicMetadata; }- Description
The parameters to update the metadata with.
- Name
params.privateMetadata?- Type
- OrganizationPrivateMetadata
- Description
Metadata that can be read and set only from the Backend API.
- Name
params.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.
const organizationId = 'org_123'
const response = await clerkClient.organizations.updateOrganizationMetadata(organizationId, {
publicMetadata: {
example: 'metadata',
},
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/organizations/{organization_id}/metadata. See the BAPI reference for more information.
Feedback
Last updated on