Get events for all the users through Rest API

I came across the below API which returns all the events of a repository:
https://docs.github.com/en/rest/reference/activity#list-repository-events

Can anyone please suggest if there is any similar API to get the events for the entire organization.
I need to get the events of all the users of the organization in order to get their last activity date.

@himankgupta81 not via the Rest API but try GraphQL API
https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#using-the-audit-log-api

thanks byrneh,

However, I already tried the audit logs API and found that it does not include details at granular level and has just the details of the activities related to the organisation like when a repository is created or a member was added etc. and it does not include the events like code pushed to the repository or issue created/updated etc… I want to get all the events of the users so that I can check when was the last time user performed any activity on GitHub.

@himankgupta81, understood.
I don’t think there is an API solution for you. Although you are not alone in asking for ability access to git actions etc across the ORGANIZATION etc.

A Webhook installed on the Organization and configured for all current and future events (you can limit to events of interest if you wish also), will send a HTTP POST payload to the webhook’s configured URL
You could look to see if this covers the scope of events you need.

The are some considerations like timeouts of your event Webhook listener does not respond in 10 seconds and possible lost events, and it being a push rather than pull model for getting events. So you need to create a highly available listener process to handle these events.


Well, unfortunately using web hooks is out of scope for me.
Is there any way I can get the user’s last activity date through REST API? I dont want to do a separate Rest call for each user so if there is any API which can give me the result in a single Query, that would be very helpful.

I think you are out of luck, nothing that I am aware of

some future public roadmap items announced relevant to this topic