Update Metadata Properties with the Management API

You can update a user's metadata properties by making a PATCH call to the Update a user endpoint.

Assuming you created a user with the following metadata values:

To update user_metadata and add the user's home address as a second-level property:

You would make the following PATCH call:

The user's profile will now appear as follows:

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 (see Deleting).

Merge properties

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.

Therefore, the corresponding PATCH call to the API would be:

Delete properties

Patching the metadata with an empty object removes the metadata completely. For example, sending this body removes everything in app_metadata:

Similarly, this clears out user_metadata:

Keep reading