updateOrganizationMembershipMetadata()
Update the metadata attributes of an OrganizationMembership by merging existing values with the provided parameters. Metadata values will be updated via a "deep" merge - "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.
function updateOrganizationMembershipMetadata(
  params: UpdateOrganizationMembershipMetadataParams,
): Promise<OrganizationMembership>- Name
 organizationId- Type
 string- Description
 The ID of the organization this membership belongs to.
- Name
 userId- Type
 string- Description
 The ID of the user that this membership belongs to.
- Name
 publicMetadata?- Type
 - OrganizationMembershipPublicMetadata
 - Description
 Metadata that can be read from both the Frontend API and Backend API, but can be set only from the Backend API.
- Name
 privateMetadata?- Type
 - OrganizationMembershipPrivateMetadata
 - Description
 Metadata that is only visible to your Backend API.
const organizationId = 'org_123'
const userId = 'user_123'
const response = await clerkClient.organizations.updateOrganizationMembershipMetadata({
  organizationId,
  userId,
  publicMetadata: {
    example: 'this value is updated!',
  },
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/organizations/{organization_id}/memberships/{user_id}/metadata. See the BAPI reference for more information.
Feedback
Last updated on