Total number of successful logins.
Note: The requirement is not total number of users logged in, I know I get that info from Activity tab in Auth0 Dashboard.
Total number of users not enrolled for MFA and the list.
For getting this info I called API - https://domain-name/api/v2/users?take=100. then I filter users based on field
“multifactor”: [
“guardian”
]
But I have more than 2k users, since the maximum users I can retrieve is 100 I have to call the API more than 20 times and do the filter. I am looking if there is a single API to get the total number of users who are not enrolled for MFA
The number of successful logins is shown through the logins_count parameter when calling the GET /api/v2/users endpoint. This documentation on how to Search Users with Query Syntax should also be handy.
The endpoint returns a maximum of 50 users, even if more users match your query.
If you need to return more than 50 users, use the page parameter to show more pages of results. Each page contains 50 users. For example, you can specify &page=2 to show results 51-100, specify &page=3 to show results 101-150, and so on. However, this endpoint never returns a total of more than 1000 users with the same search criteria, even with paging.
However you can Export all Users using the POST /api/v2/jobs/users-exports endpoint and query the “multifactor”: [“guardian”] as you have specified above, then subtract them from the total. You can also check this KB article.
I should have been more clear about my question. I am looking for total number logins for all users for a particular day or the day that had greatest logins in a day of a particular month.
I am not looking for total number of logins for a particular user.
In this case i would recommend using the GET /api/v2/stats/daily endpoint from the Management API, documented under Get daily stats, which can retrieve the number of logins that occurred each day within a specified date range. This way you can use the query parameters offered by the endpoint and check for a specific day, or a month.
This should better fit your use case and if you have additional questions please let me know.
Best regards,
Remus