Additional filter options for the `users` query

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! :smile:

Some example cases for the request above I’d like to add:

User filters/selectors
Let’s say we have a user selector that adds a user to a list on the page. If the user is already selected, we’d like to exclude them from the selection. Besides that, if the user scrolls to the bottom of the menu, we load the next page. Excluding the already selected users results in a potential “random” number of users being returned from the query.

Account-wide user settings
An admin can, using the app settings, adjust several settings per user (think about permissions and access for example). This list of users is paginated. Imagine wanting to restrict access on a user level for all users that are currently viewers, or show all guests and pick a few of them. For cases like these, filters per monday.com role would be very helpful.
Another example would be to filter on users who don’t have access to our app: we save a list of users that have access in our own database. Fetching users paginated while excluding those users would make this a lot easier, as doing pagination here is almost impossible, as the results per page would differ.