# Could not sort users by email\_verified

**URL:** <https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [March 2, 2023, 10:36am UTC](https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629 "2023-03-02T10:36:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicu/32/45060_2.png) [@nicu](https://community.auth0.com/u/nicu)\
**Post date:** [March 2, 2023, 10:36am UTC](https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629/1 "2023-03-02T10:36:03Z")

</div>

I’m trying to search users and sort them by `email_confirmed` property, using `sort` query parameter.

```auto
curl --request GET \
  --url 'https://{yourDomain}/api/v2/users?sort=email_verified%3A-1&search_engine=v3' \
  --header 'authorization: Bearer {yourMgmtApiAccessToken}'

```

But unfortunately, results are not sorted.

Inside page [Sort Search Results](https://auth0.com/docs/manage-users/user-search/sort-search-results) it’s mentioned only about following fields:

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

Is this a bug? Is there any other way to perform the sorting by this field?

Thank you

---

<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:** [March 3, 2023, 12:42am UTC](https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629/3 "2023-03-03T00:42:22Z")

</div>

Hi @nicu,

Welcome to the Auth0 Community!

After my investigation, I managed to reproduce the same issues. I was not able to sort based on the `email_verified` property.

Given that, I am going to reach out to our Engineers regarding this bug and have them address this issue.

I will follow up on this thread once it has been resolved.

Thanks,  
Rueben

---

<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:** [March 13, 2023, 9:09pm UTC](https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629/5 "2023-03-13T21:09:06Z")

</div>

Hi @nicu.

Thank you for your patience.

I have collaborated with our Engineers and learned that the [Management API’s List of Search users](https://auth0.com/docs/api/management/v2#!/Users/get_users) endpoint details the sort functionality applying only to strings:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/7/6/762a71f3c4e5f78467337e7fc9d40a702bb99e9c.png)

To filter for the `email_verified: true` property, there is the option to use the `q` (query) field. For example:

```auto
curl -H "Authorization: Bearer <token>" https://{yourDomain}/api/v2/users?q=email_verified%3A%20false

```

Please let me know if you have any additional questions. I’d be happy to help!

Thanks,  
Rueben

---

<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:** [March 27, 2023, 9:09pm UTC](https://community.auth0.com/t/could-not-sort-users-by-email-verified/101629/6 "2023-03-27T21:09:18Z")

</div>

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