How to get a list of users with f.i. "last seen" information?

We would like to track our user’s activity and licensing. Therefore we would like to query the atlassian system for all known users of our organization incl. information like “last seen” for each product.

Is there an SDK or REST API endpoint that gets a list of all users like I have in “admin.atlassian.com” → my organization → Directory → Managed Accounts? Something like the “CSV List” that I get when I click “export accounts”, but without waiting for the email, using the link in the email and open the webpage and wait for the csv download to happen…

br,
Alex

Hello Alexander

Take a look at this API:
https://developer.atlassian.com/cloud/admin/organization/rest/api-group-orgs/#api-orgs-orgid-users-get
It retrieves all managed accounts with the last_active field for each product.
Be carefully, I have an open case with Atlassian because it is not consistent and I get different results every time we ask the API, but in theory this is way.