# How can I sort invites to an organization using management api?

**URL:** <https://community.auth0.com/t/how-can-i-sort-invites-to-an-organization-using-management-api/182945>\
**Category:** Get Help\
**Tags:** organizations-management-api, management-api\
**Created:** [February 27, 2025, 10:02am UTC](https://community.auth0.com/t/how-can-i-sort-invites-to-an-organization-using-management-api/182945 "2025-02-27T10:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erik.olausson](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/erik.olausson/32/73264_2.png) [@erik.olausson](https://community.auth0.com/u/erik.olausson)\
**Post date:** [February 27, 2025, 10:02am UTC](https://community.auth0.com/t/how-can-i-sort-invites-to-an-organization-using-management-api/182945/1 "2025-02-27T10:02:47Z")

</div>

In the documentation for the Auth0 Management API, it states that the endpoint “GET /api/v2/organizations/{id}/invitations” should accept a sort-parameter as a string with the format “field:order”. But when I try this by sorting on any field other than “created\_at” it gives me the following error:  
“auth0.exceptions.Auth0Error: 400: Query validation error: ‘String does not match pattern ^((created\_at)):(1|-1)$: expires\_at:1’ on property sort (Field to sort by. Use field:order where order is 1 for ascending and -1 for descending Defaults to created\_at:-1).”

There is definately a field called expires\_at, so that’s not the issue. But it seems the API does not support sorting on other fields than created\_at, despite of what the documentation says. Can anybody enlighted me on this? Thanks!

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [March 31, 2025, 9:43pm UTC](https://community.auth0.com/t/how-can-i-sort-invites-to-an-organization-using-management-api/182945/3 "2025-03-31T21:43:50Z")

</div>

Hi @erik.olausson

Welcome to the Auth0 Community!

I’m sorry for not responding to you earlier, I’ve opened a ticket for our engineering team to check this report.

Thank you for sharing!  
Dawid

---

<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:** [April 14, 2025, 9:44pm UTC](https://community.auth0.com/t/how-can-i-sort-invites-to-an-organization-using-management-api/182945/4 "2025-04-14T21:44:42Z")

</div>

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