You can update a user’s metadata by making a PATCH call to the Management API /patch_users_by_id endpoint.Assuming you created a user with the following metadata values:
When you send a PATCH call in which you have set a property’s value to null (for example, {user_metadata: {color: null}}), Auth0 deletes the property/value from the database. Also, patching the metadata itself with an empty object removes the metadata completely.
Only properties at the root level are merged into the object. All lower-level properties will be replaced.For example, to add a user’s work address as an additional inner property, you would have to include the complete contents of the addresses property. Since the addresses object is a root-level property, it will be merged into the final JSON object representing the user, but its sub-properties will not.
Report incorrect code
Copy
Ask AI
{ "user_metadata": { "addresses": { "home": "123 Main Street, Anytown, ST 12345", "work": "100 Industrial Way, Anytown, ST 12345" } }}
Therefore, the corresponding PATCH call to the API would be:
Client metadata can be updated using the PATCH /api/v2/clients/{id} endpoint, supplying an application object with the clientMetadata property, which has a value that consists of an object containing the metadata you’d like to change.Application before:
Client metadata keys can be removed by issuing a PATCH, as described in “Update app_metadata” above, but supplying null for the key value. This behavior matches that of the user_metadata and app_metadata properties in the PATCH/api/v2/users/ endpoint.