
User16712236963047299040 (Customer) asked a question.
After several years of us, our Okta database has collected hundreds of thousands of accounts from users of our web content. I feel certain that a decent percentage of accounts are no longer being used and I would like to clean up the accounts that have not been used in more than XX months (or whatever time period is available). Is there a way to first determine how many accounts have had no recent activity and then to delete those accounts? I assume that we would use some sort of script (Python, etc) to delete the accounts, but I'd like to get a feel for how many accounts we are targeting. Also, going forward I would like to set a routine that would automatically delete an account after a certain period of inactivity. Sounds like there is a setting available to inactivate accounts, does it also delete them?

@User16712236963047299040 (Customer)
please reference the document:
https://support.okta.com/help/s/article/How-to-bulk-delete-users-via-Postman?language=en_US
or
https://support.okta.com/help/s/article/How-to-Perform-a-Bulk-Delete-of-Okta-Users-With-API?language=en_US
the scrpit:
https://github.com/OktaSupport/delete-users-ps-script