Help with complex filtering

I would like to create a filter that queries my users in a kind of complex way. This is an example:

(wasBetaUser === true && is_sub_user === false) OR (wasBetaUser === true && Subscription.ID === 4)

not sure how to approach this, would someone be able to help please?

This topic has been created from a Discord post (1273005462857584650) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Might want to explore something along these lines with an API call:

GET /api/users?filters[$or][0][wasBetaUser]=true&filters[$or][0][is_sub_user]=false&filters[$or][1][wasBetaUser]=true&filters[$or][1][Subscription.ID]=4

Also make sure the api call for users is available in your Roles settings.

Here are the docs: Filters, Locale, and Publication State | Strapi Documentation