@maysilees I don't believe we have a setting for this but you could add your own lambda, which you would then have to do an API call to check for the number of users.

https://fusionauth.io/docs/extend/code/lambdas/

https://fusionauth.io/docs/extend/code/lambdas/self-service-registration#self-service-registration-validation-lambda

To check the number of users in a specific tenant using the FusionAuth API, you can use the "Search for Users" API endpoint. This endpoint allows you to search for users within a tenant and can be used to count the number of users. You would need to set the tenantId in the search criteria to scope the search to a specific tenant.
Here is an example of how you might use the API to search for all users within a tenant and count them:

FusionAuthClient client = new FusionAuthClient("your-api-key", "http://localhost:9011"); ClientResponse<UserSearchResponse, Errors> response = client.searchUsersByQueryString("tenantId:your-tenant-id"); if (response.wasSuccessful()) { // The total number of users in the tenant can be retrieved from the total field in the response int totalUsersInTenant = response.successResponse.total; System.out.println("Total users in tenant: " + totalUsersInTenant); } else { // Handle error response }

Please replace your-api-key with your actual API key and your-tenant-id with the ID of the tenant you want to search. The searchUsersByQueryString method is used to perform the search, and the total field in the successful response will give you the count of users in the specified tenant.
Note that the above code is a conceptual example based on the information provided in the extracts. The actual implementation may vary depending on the version of the FusionAuth client library you are using and the specific details of your application.
For more details on the "Search for Users" API, you can refer to the FusionAuth API documentation, which would typically be found at the following link: Search for Users API. However, please note that this link was not provided in the extracts, so you should consult the official FusionAuth documentation for the most accurate and up-to-date information.