Changes: list

Requires authorization

Lists the changes for a user. Try it now or see an example.


HTTP request



Parameter name Value Description
Optional query parameters
includeDeleted boolean Whether to include deleted items. (Default: true)
includeSubscribed boolean Whether to include public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own. (Default: true)
maxResults integer Maximum number of changes to return. Acceptable values are 0 to 1000, inclusive. (Default: 100)
pageToken string Page token for changes.
spaces string A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.
startChangeId long Change ID to start listing changes from.


This request requires authorization with at least one of the following scopes (read more about authentication and authorization).


Request body

Do not supply a request body with this method.


If successful, this method returns a response body with the following structure:

  "kind": "drive#changeList",
  "etag": etag,
  "selfLink": string,
  "nextPageToken": string,
  "nextLink": string,
  "largestChangeId": long,
  "items": [
    changes Resource
Property name Value Description Notes
kind string This is always drive#changeList.
etag etag The ETag of the list.
nextPageToken string The page token for the next page of changes.
largestChangeId long The current largest change ID.
items[] list The actual list of changes.


Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).


Uses the Java client library.


import java.util.ArrayList;
import java.util.List;

// ...

public class MyClass {

  // ...

   * Retrieve a list of Change resources.
   * @param service Drive API service instance.
   * @param startChangeId ID of the change to start retrieving subsequent
                          changes from or {@code null}.
   * @return List of Change resources.
  private static List<Change> retrieveAllChanges(Drive service,
      Long startChangeId) throws IOException {
    List<Change> result = new ArrayList<Change>();
    Changes.List request = service.changes().list();

    if (startChangeId != null) {
    do {
      try {
        ChangeList changes = request.execute();

      } catch (IOException e) {
        System.out.println("An error occurred: " + e);
    } while (request.getPageToken() != null &&
             request.getPageToken().length() > 0);

    return result;

  // ...



Uses the .NET client library.

using Google.Apis.Authentication;
using Google.Apis.Drive.v2;
using Google.Apis.Drive.v2.Data;

using System.Collections.Generic;
// ...

public class MyClass {

  // ...

  /// <summary>
  /// Retrieve a list of Change resources.
  /// </summary>
  /// <param name="service">Drive API service instance.</param>
  /// <param name="startChangeId">
  /// ID of the change to start retrieving subsequent changes from or null.
  /// </param>
  /// <returns>List of Change resources.</returns>
  public static List<Change> retrieveAllChanges(DriveService service,
      String startChangeId) {
    List<Change> result = new List<Change>();
    ChangesResource.ListRequest request = service.Changes.List();

    if (!String.IsNullOrEmpty(startChangeId)) {
      request.StartChangeId = startChangeId;
    do {
      try {
        ChangeList changes = request.Execute();

        request.PageToken = changes.NextPageToken;
      } catch (Exception e) {
        Console.WriteLine("An error occurred: " + e.Message);
        request.PageToken = null;
    } while (!String.IsNullOrEmpty(request.PageToken));
    return result;

  // ...


Uses the PHP client library.

 * Retrieve a list of Change resources.
 * @param Google_Service_Drive $service Drive API service instance.
 * @param String $startChangeId ID of the change to start retrieving subsequent
 *     changes from or NULL.
 * @return Array List of Google_Service_Drive_Change resources.
function retrieveAllChanges($service, $startChangeId = NULL) {
  $result = array();
  $pageToken = NULL;

  do {
    try {
      $parameters = array();
      if ($startChangeId) {
        $parameters['startChangeId'] = $startChangeId;
      if ($pageToken) {
        $parameters['pageToken'] = $pageToken;
      $changes = $service->changes->listChanges($parameters);

      $result = array_merge($result, $changes->getItems());
      $pageToken = $changes->getNextPageToken();
    } catch (Exception $e) {
      print "An error occurred: " . $e->getMessage();
      $pageToken = NULL;
  } while ($pageToken);
  return $result;


Uses the Python client library.

from apiclient import errors
# ...

def retrieve_all_changes(service, start_change_id=None):
  """Retrieve a list of Change resources.

    service: Drive API service instance.
    start_change_id: ID of the change to start retrieving subsequent changes
                     from or None.
    List of Change resources.
  result = []
  page_token = None
  while True:
      param = {}
      if start_change_id:
        param['startChangeId'] = start_change_id
      if page_token:
        param['pageToken'] = page_token
      changes = service.changes().list(**param).execute()

      page_token = changes.get('nextPageToken')
      if not page_token:
    except errors.HttpError, error:
      print 'An error occurred: %s' % error
  return result


Uses the JavaScript client library.

 * Retrieve a list of Change resources.
 * @param {Function} callback Function to call when the request is complete.
 * @param {String} startChangeId ID of the change to start retrieving subsequent
 *                               changes from or {@code null}.
function retrieveAllChanges(callback, startChangeId) {
  var retrievePageOfChanges = function(request, result) {
    request.execute(function(resp) {
      result = result.concat(resp.items);
      var nextPageToken = resp.nextPageToken;
      if (nextPageToken) {
        request ={
          'pageToken': nextPageToken
        retrievePageOfChanges(request, result);
      } else {
  var initialRequest;
  if (startChangeId) {
    initialRequest ={
      'startChangeId' : startChangeId
  } else {
    initialRequest =;
  retrievePageOfChanges(initialRequest, []);


Uses the Go client library.

import (

// AllChanges fetches all changes after a starting change
func AllChanges(d *drive.Service,
    startChangeId string) ([]*drive.Change, error) {
  var cs []*drive.Change
  pageToken := ""
  for {
    q := d.Changes.List()
    // If we have a pageToken set, apply it to the query
    if pageToken != "" {
      q = q.PageToken(pageToken)
    r, err := q.Do()
    if err != nil {
      fmt.Printf("An error occurred: %v\n", err)
      return cs, err
    cs = append(cs, r.Items...)
    pageToken = string(r.NextPageToken)
    if pageToken == "" {
  return cs, nil


Uses the Objective-C client library.

#import "GTLDrive.h"
// ...

+ (void)retrieveAllChangesWithService:(GTLServiceDrive *)service
                        startChangeId:(long long)startChangeId
                      completionBlock:(void (^)(NSArray *, NSError *))completionBlock {
  // The service can be set to automatically fetch all pages of the result. More information
  // can be found on <a href=""></a>.
  service.shouldFetchNextPages = YES;

  GTLQueryDrive *query = [GTLQueryDrive queryForChangesList];
  if (startChangeId != -1) {
    query.startChangeId =  startChangeId;
  // queryTicket can be used to track the status of the request.
  GTLServiceTicket *queryTicket =
    [service executeQuery:query
        completionHandler:^(GTLServiceTicket *ticket, GTLDriveChangeList *changes,
                            NSError *error) {
          if (error == nil) {
            completionBlock(changes.items, nil);
          } else {
            NSLog(@"An error occurred: %@", error);
            completionBlock(nil, error);

// ...

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Send feedback about...

Drive REST API v2
Drive REST API v2