# Clear user nickname from the API

**URL:** <https://community.auth0.com/t/clear-user-nickname-from-the-api/88953>\
**Category:** Get Help\
**Tags:** profile-update, api, nickname, bug\
**Created:** [August 18, 2022, 10:48am UTC](https://community.auth0.com/t/clear-user-nickname-from-the-api/88953 "2022-08-18T10:48:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasper.law](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jasper.law/32/33232_2.png) [@jasper.law](https://community.auth0.com/u/jasper.law)\
**Post date:** [August 18, 2022, 10:48am UTC](https://community.auth0.com/t/clear-user-nickname-from-the-api/88953/1 "2022-08-18T10:48:54Z")

</div>

Hi,

I can see from the [get user spec](https://auth0.com/docs/api/management/v2/#!/Users/get_users_by_id) that the nickname field of a user is optional.  
When updating a user ([patch by id](https://auth0.com/docs/api/management/v2/#!/Users/patch_users_by_id)), is it possible to clear the user’s nickname?  
Since this endpoint is a PATCH, giving nickname as null signals no change to the field, but giving nickname as `""` gives a validation error: `String is too short (0 chars), minimum 1' on property nickname (Preferred nickname or alias of this user)`.

I’m marking this thread with ‘bug’ due to documentation inconsistency.

Many thanks for any help in advance,  
Jasper

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [August 18, 2022, 8:10pm UTC](https://community.auth0.com/t/clear-user-nickname-from-the-api/88953/3 "2022-08-18T20:10:40Z")

</div>

Hi @jasper.law ,

To clear the nickname field, I tried below body script by [updating a user](https://auth0.com/docs/api/management/v2/?_gl=1*1b1zvzw*rollup_ga*MjA5MTA5MTk2MC4xNjQ4NzQwNzU4*rollup_ga_F1G3E656YZ*MTY2MDg1MzA4Ni4xMjQuMC4xNjYwODUzMDg2LjYwLjAuMA..&_ga=2.35511652.41323565.1660578252-2091091960.1648740758#!/Users/patch_users_by_id) and it works.

```auto
{
  "nickname": null
}

```

Could you try and see if it works? Thanks!

---

<div class="post-metadata">

**Author:** ![jasper.law](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jasper.law/32/33232_2.png) [@jasper.law](https://community.auth0.com/u/jasper.law)\
**Post date:** [August 22, 2022, 11:12am UTC](https://community.auth0.com/t/clear-user-nickname-from-the-api/88953/4 "2022-08-22T11:12:26Z")

</div>

Yes, many thanks, this is now solved 🙂

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 11:36am UTC](https://community.auth0.com/t/clear-user-nickname-from-the-api/88953/5 "2022-12-22T11:36:16Z")

</div>


