# Update user metadata with ManagementApi Client

**URL:** <https://community.auth0.com/t/update-user-metadata-with-managementapi-client/76752>\
**Category:** Get Help\
**Tags:** user\_metadata, api, management-api, auth0\
**Created:** [January 20, 2022, 7:41pm UTC](https://community.auth0.com/t/update-user-metadata-with-managementapi-client/76752 "2022-01-20T19:41:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RunLong](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/runlong/32/33258_2.png) [@RunLong](https://community.auth0.com/u/RunLong)\
**Post date:** [January 20, 2022, 7:41pm UTC](https://community.auth0.com/t/update-user-metadata-with-managementapi-client/76752/1 "2022-01-20T19:41:51Z")

</div>

I’m trying to update the user\_metadata using the .NET ManagementApi client. I see the UserMetadata property, and can get the values. However, I’m not seeing how to set the values. When I try to update it directly, like below, I get the following error: RuntimeBinderException: Cannot perform runtime binding on a null reference

Anyone have any examples of how they do this?

- **Which SDK this is regarding:** e.g. auth0-node  
.NET Package, Auth0.ManagementApi
- **SDK Version:** e.g. 2.29.0  
7.12.0
- **Platform Version:** e.g. Node 12.19.0  
.NET 6
- **Code Snippets/Error Messages/Supporting Details/Screenshots:**  
var userUpdateRequest = new UserUpdateRequest()  
{  
FirstName = firstName,  
LastName = lastName  
};  
userUpdateRequest.UserMetadata.PhoneNumber = phoneNumber;  
return await \_auth0ManagementClient.Users.UpdateAsync(userId, userUpdateRequest);

**Is this a feature request or bug report?** If so, please create an issue directly in the corresponding GitHub repo. The Community SDK category is for general discussion and support.  
Nope

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 21, 2022, 10:53pm UTC](https://community.auth0.com/t/update-user-metadata-with-managementapi-client/76752/3 "2022-01-21T22:53:26Z")

</div>

Hi @RunLong,

Welcome to the Auth0 Community!

To update the user’s user\_metadata with the ManagementClient, you need to call the `updateUserMetadata` method. See below for an example.

```auto
var params = { id: USER_ID };
var metadata = {
  address: '123th Node.js Street'
};

management.updateUserMetadata(params, metadata, function (err, user) {
  if (err) {
    // Handle error.
  }

  // Updated user.
  console.log(user);
});

```

You may find the [updateUserMetadata reference](https://auth0.github.io/node-auth0/module-management.ManagementClient.html#updateUserMetadata) useful.

Please let me know if there’s anything else I can do to help.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 5, 2022, 10:54pm UTC](https://community.auth0.com/t/update-user-metadata-with-managementapi-client/76752/4 "2022-02-05T22:54:19Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
