Introduction to Google Drive Activity API

This document provides an overview of the Google Drive Activity API.

The Drive Activity API lets you query for recent events. You can fetch adetailed history of all activities, including granular information about eachevent. This is useful for tasks like audits as you can retrieve preciseactivities that include theActionDetail,Actor, andTarget information.

The Drive Activity API consists of theDriveActivity resource, which representschanges made to objects within a user's Google Drive, and theactivity.query method, which lets you retrieveinformation about those changes.

Request

Your app requests a user's activity data using theactivity.query method. You can request activity either for a specificDrive item or for everything contained under aDrive folder. For a given request, you can choose to restrict theresponse by using afilter such as time rangeor action type, and you can choose to have the activityconsolidated in the response. For more information,seeMake requests in the Google Drive Activity API.

Response

The response contains a list of activities matching the given parameters, whereaDriveActivity resource represents eachactivity:

Explanation of the Drive Activity API response body message.
Figure 1. Explanation of the Drive Activity API response body message.

ADriveActivity resource is a collection ofAction objects, each of which is self-containedlike anevent. AnAction includes anActionDetail (such asCreate orEdit), anActor (such asUser orAdministrator), aTarget (such asDriveItem orDrive), and either aTimestamporTimeRange.

ADriveActivity resource also contains summary information, such as everyActor andTarget from all the actions, a unifiedTimestamp orTimeRange,and either the most important or representativeActionDetail of theAction.

For more information, see theDrive Activity API datamodel.

Activity history visibility

Some activity on Drive might not be reported when you use theDrive Activity API. Whether the API reports a given change to an objectdepends on whether the change, or information about the change, is visible tothe authenticated user in your app.

Visibility is based on the permissions set for the object. There are severalscenarios when files and folders are shared in Drive:

  • If an author shares a document, the activity history for the document isvisible to both the creator and the users with whom it was shared.

  • If a document was shared with a user and then made private, the user can seeall activity history from the period when they had access, but not afterpermissions were restricted.

  • If a document was never shared with a user, the user can't see any activityhistory.

Related topics

  • To get the most out of the Drive Activity API, first integrate your appwith theGoogle Drive API
  • To learn about developing with Google Workspace APIs, including creating aproject or handling authentication and authorization, refer toDevelop onGoogle Workspace.
  • To learn about activities, see theAPI reference.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.