# How to remove restricted value in app\_metadata?

**URL:** <https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [April 7, 2022, 2:56pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381 "2022-04-07T14:56:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.matsunaga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/richard.matsunaga/32/13599_2.png) [@richard.matsunaga](https://community.auth0.com/u/richard.matsunaga)\
**Post date:** [April 7, 2022, 2:56pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/1 "2022-04-07T14:56:42Z")

</div>

We have been adding a restricted key (user\_id) to the app\_metadata. I want to stop doing this, but I can’t seem to edit the metadata from the dashboard for existing users.

The error is:

Error!Payload validation error: ‘Invalid property app\_metadata.user\_id’

Is there any way I can fix existing app\_metadata? I would rather do this manually via the dashboard rather than figure out how to do so via the REST API, as we only have a small number of developers with accounts right now.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 7, 2022, 5:40pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/3 "2022-04-07T17:40:46Z")

</div>

Hi @richard.matsunaga

Welcome to the Auth0 Community!

You should be able to edit any app\_metadata property. It sounds like this may be a UI bug or an issue with what you are trying to update. Could you please post a sample of the existing properties and what you are trying to replace them with? Please exclude/obscure any sensitive info.

---

<div class="post-metadata">

**Author:** ![richard.matsunaga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/richard.matsunaga/32/13599_2.png) [@richard.matsunaga](https://community.auth0.com/u/richard.matsunaga)\
**Post date:** [April 7, 2022, 8:10pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/4 "2022-04-07T20:10:56Z")

</div>

user\_metadata:

```auto
{
  "tenant_id": "zOXyAmg23gbF3dxpR6nP6"
}

```

app\_metadata:

```auto
{
  "user_id": "v_DlVTlCkxySBGzO2TnQA"
}

```

I want to do 2 things, move the `tenant_id` to app\_metadata where it belongs and rename or remove the `user_id` that we have generated that is a restricted key and appears to override the auth0-generated `user_id`.

We have an action flow step on login that adds these 2 values to the access token. Could that be preventing edits here?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 8, 2022, 9:22pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/5 "2022-04-08T21:22:48Z")

</div>

I think I see what is happening.

- The `user_id` field isn’t allowed in app\_metadata (more on that [here](https://auth0.com/docs/manage-users/user-accounts/metadata/metadata-fields-data#restrictions)).
- You were able to find a workaround to set it (I’m going to file a bug report for this)
- The Dashboard UI tries to clear it out by setting `"user_id":null`, which isn’t allowed.

I was able to clear it out by making an API call (I know you were trying to avoid this, sorry!).

**The good news:** You can use our management API explorer to do this fairly easily.

Using the [Management API Explorer Update a User endpoint](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id), you can send a request without much code. All you need is a valid token, the user\_id (not the one in app\_metadata 😄) from the dashboard, and this body `{"app_metadata":{}}` to clear the user’s app\_metadata.

**Like this:**

 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/c/ac7b7fd2caa97f85f93b6ce68fd3a62b1b369478.png)

Let me know if you have any questions!

---

<div class="post-metadata">

**Author:** ![shannon.paige](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shannon.paige/32/13031_2.png) [@shannon.paige](https://community.auth0.com/u/shannon.paige)\
**Post date:** [May 17, 2022, 10:18pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/6 "2022-05-17T22:18:10Z")

</div>

Wanted to add that we were also able to set a restricted field in app\_metadata. We did it via a custom database action script.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2022, 10:34pm UTC](https://community.auth0.com/t/how-to-remove-restricted-value-in-app-metadata/81381/7 "2022-06-28T22:34:38Z")

</div>


