Page Summary
-
The Admin SDK Reports service in Apps Script allows Google Workspace administrators to create custom usage reports using the Admin SDK Reports API.
-
This is an advanced service that needs to be enabled before it can be used.
-
Detailed information and reference documentation for the Admin SDK Reports API are available.
-
Sample code is provided to demonstrate generating both login activity reports and user usage reports as spreadsheets.
create custom usage reports for Google Workspace domains.
The Admin SDK Reports service allows you to use the Admin SDK's Reports API in Google Apps Script. This API gives administrators of Google Workspace domains (including resellers) the ability to create custom usage reports for their domain.
This is an advanced service that must be enabled before use.
Reference
For detailed information on this service, see the reference documentation for the Admin SDK Reports API. Like all advanced services in Apps Script, the Admin SDK Reports service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.
To report issues and find other support, see the Admin SDK Reports support guide.
Sample code
The following sample code uses version 1 of the API.
Generate login activity report
This sample generates a login activity report for the last week as a spreadsheet. The report includes the time, user, and login result.
Generate user usage report
This sample generates a user usage report for this day last week as a spreadsheet. The report includes the date, user, last login time, number of emails received, and number of docs owned.