Custom Gating Rules
Grant roles to users based on your own API.
How do custom gating rules work?
Custom gating rules can connect to your own API and grant roles to users in your server based on the response.
Flipsuite will trigger the endpoint you provide with a POST
request which contains both role and user details
each time user roles are refreshed (automatically or due to user manually verifying their eligibility for the roles).
Your endpoint should return either a numeric value (for attributes like points, score or exp in your app) or a boolean value denoting whether the role should be granted or not, if you prefer to check the conditions on your own.
Adding custom gating rules
To add your first custom gating rule, go to the “Rules” tab, click the “Create new rule” button, and choose Custom Gating Rule to get started.
Empty rules tab
For the sake of an example, let’s say you have an application with a swap feature and you want to grant the @Tradoor
role to every person who generates at least $500 in volume on it. You also have an API endpoint at /api/user-volume
that takes the request received from Flipsuite and returns the total volume (in USD) generated by the user, based on the
wallets linked to their account.
Here are the settings you would configure when creating a custom gating rule for this case:
Custom Gating Rule form
Result
After configuring and adding the above custom gating rule, your page should look similar to the screenshot below.
Rules tab
You are ready to set up a gating verification message in your server now!