Hi! We’d love to add some more filter options to the users
query in the API. We’ve been running into several cases where we want to include or exclude users based on certain user properties. We’re using pagination a lot when it comes to users. We have several cases where this becomes harder to do “nicely” without exhausting the API. In total, there are three filters we’d love to see:
The first and most useful one would be to exclude a list of users by their ids. We now have to do this ourselves, and especially when we make paginated calls, we run into an inconsistent amount per page. We could resolve this by calling the next page until we have the limit we want, but that only exhausts the budget more quickly. And with a larger list of users, it only costs more and more calls.
Something along these lines would be nice:
users (exclude: ["12345678", "87654321"]) {
id
name
email
}
The second one is a filter for teams. We are aware of the teams
{ users
…} query. However, this results in a list of users per team, not a single list of distinct users. Furthermore, pagination is difficult too, since the limit applies to every list of users per team and not a total limit. The table in Administration > Users is able to do this, so something similar would be most helpful:
users (teams: ["123456", "654321"]) {
id
name
email
}
And the last one, also seeing it is possible in Administration > Users, is a filter per role (admin, member, guest and viewer). Here too, we have to do the filtering ourselves and ask for the three user properties, making the request more complex. Even if it’s a call per role, that would be helping out a lot already.
I’m also curious to learn if there are more people interested and running into this, and if and how you work around this!