updateUserMetadata()
Updates the metadata associated with the specified user 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
.
- Name
userId
- Type
string
- Description
The ID of the organization to update.
- 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.
Example
In this example, you can see that the returned User
object has its publicMetadata
property updated with the new metadata provided.
Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/users/{user_id}/metadata
. See the BAPI reference for more details.
Feedback
Last updated on