# Get user count to create auto purge of application users

**URL:** <https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [September 9, 2023, 7:37am UTC](https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825 "2023-09-09T07:37:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lauro235](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lauro235/32/50693_2.png) [@Lauro235](https://community.auth0.com/u/Lauro235)\
**Post date:** [September 9, 2023, 7:37am UTC](https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825/1 "2023-09-09T07:37:34Z")

</div>

Hi there,

I’m building an app and have concerns regarding rate limits. Not just within AuthO, but other databases and services that users will be able to access.

Because of these concerns, I want to restrict the number of users to 10. and give the users a limited amount of time to ‘play’ on the application site. After this time I want to remove their permissions automatically to allow new users to sign up. This will happen in parallel with their data in the DB, in order to keep within user rates.

Could this be done? What tools and techniques do you recommend using?

This looks like it might be pretty useful

[GET users endpoint](https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-by-id-endpoint)

## Similar past requests

[2017 Suggestion](https://community.auth0.com/t/is-there-any-way-to-get-the-number-of-registered-users-from-my-auth0-account/6130)  
[2022 suggestion](https://community.auth0.com/t/new-endpoint-to-get-the-total-number-of-users/81352)

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [September 12, 2023, 9:25pm UTC](https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825/3 "2023-09-12T21:25:19Z")

</div>

Hello @Lauro235 welcome to the community!

> [@Lauro235](#):
>
> Could this be done? What tools and techniques do you recommend using?

Interesting use case! I think this could certainly be done, and Auth0 provides plenty of tools to do so 🙂 The `/users` endpoint would definitely be helpful, and each `user` object has a `created_at` value which could help you keep track of when users were created. Auth0 provides a number of Management API SDK Libraries that can be found [here](https://auth0.com/docs/libraries) - These are designed to be useful in scenarios like you’ve described where interacting with the Management API are the primary focus.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Lauro235](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lauro235/32/50693_2.png) [@Lauro235](https://community.auth0.com/u/Lauro235)\
**Post date:** [September 17, 2023, 7:53am UTC](https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825/4 "2023-09-17T07:53:23Z")

</div>

Hi tyf,

Thanks so much for your response. I’m finally starting to get the hang of the management api! I’m having loads of fun 😅.

I have a follow up question though. I currently have two users in my api. Both belong to me. One is a Github account and the other is the default google user.

Is it safe to purge both my Github and Google accounts? Are there any gotchas (i.e being locked out)?

Thanks for your help 🕶

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 1, 2023, 7:54am UTC](https://community.auth0.com/t/get-user-count-to-create-auto-purge-of-application-users/115825/5 "2023-10-01T07:54:21Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
