# Management API - Sorting by app\_metadata fields not working

**URL:** <https://community.auth0.com/t/management-api-sorting-by-app-metadata-fields-not-working/99599>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [February 2, 2023, 8:04pm UTC](https://community.auth0.com/t/management-api-sorting-by-app-metadata-fields-not-working/99599 "2023-02-02T20:04:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdamD](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adamd/32/44003_2.png) [@AdamD](https://community.auth0.com/u/AdamD)\
**Post date:** [February 2, 2023, 8:04pm UTC](https://community.auth0.com/t/management-api-sorting-by-app-metadata-fields-not-working/99599/1 "2023-02-02T20:04:37Z")

</div>

I am using the Management API to do user searching, at https://(mydomain).auth0.com/api/v2/users. This has been good so far, but I have a requirement to sort my results by a second-level app\_metadata property (e.g. my sort field is like ‘app\_metadata.CustomObject.CustomProperty:1’). This isn’t working - the users come back in the default order. I’ve noted that sorting does work as expected when using top-level user properties. If I can’t sort on metadata properties then is there a way to get custom top-level User properties added?

Thanks in advance!

---

<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:** [February 6, 2023, 9:18pm UTC](https://community.auth0.com/t/management-api-sorting-by-app-metadata-fields-not-working/99599/3 "2023-02-06T21:18:09Z")

</div>

Hi @AdamD,

Welcome to the Auth0 Community!

According to this doc, [Sort Search Results](https://auth0.com/docs/manage-users/user-search/sort-search-results) :

> Sorting by `app_metadata` or `user_metadata` is not supported.

Root attribute limitations are listed here, [User Profile Root Attributes](https://auth0.com/docs/manage-users/user-accounts/user-profiles/root-attributes)

---

<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 20, 2023, 9:18pm UTC](https://community.auth0.com/t/management-api-sorting-by-app-metadata-fields-not-working/99599/4 "2023-02-20T21:18:43Z")

</div>

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