Revisions

Stay organized with collections Save and categorize content based on your preferences.

For a list of methods for this resource, see the end of this page.

Resource representations

The metadata for a revision to a file.

{
  "kind": "drive#revision",
  "id": string,
  "mimeType": string,
  "modifiedTime": datetime,
  "keepForever": boolean,
  "published": boolean,
  "publishedLink": string,
  "publishAuto": boolean,
  "publishedOutsideDomain": boolean,
  "lastModifyingUser": {
    "kind": "drive#user",
    "displayName": string,
    "photoLink": string,
    "me": boolean,
    "permissionId": string,
    "emailAddress": string
  },
  "originalFilename": string,
  "md5Checksum": string,
  "size": long,
  "exportLinks": {
    (key): string
  }
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "drive#revision".
id string The ID of the revision.
mimeType string The MIME type of the revision.
modifiedTime datetime The last time the revision was modified (RFC 3339 date-time).
keepForever boolean Whether to keep this revision forever, even if it is no longer the head revision. If not set, the revision will be automatically purged 30 days after newer content is uploaded. This can be set on a maximum of 200 revisions for a file.

This field is only applicable to files with binary content in Drive.

writable
published boolean Whether this revision is published. This is only applicable to Docs Editors files. writable
publishAuto boolean Whether subsequent revisions will be automatically republished. This is only applicable to Docs Editors files. writable
publishedOutsideDomain boolean Whether this revision is published outside the domain. This is only applicable to Docs Editors files. writable
lastModifyingUser nested object The last user to modify this revision.
lastModifyingUser.kind string Identifies what kind of resource this is. Value: the fixed string "drive#user".
lastModifyingUser.displayName string A plain text displayable name for this user.
lastModifyingUser.me boolean Whether this user is the requesting user.
lastModifyingUser.permissionId string The user's ID as visible in Permission resources.
lastModifyingUser.emailAddress string The email address of the user. This may not be present in certain contexts if the user has not made their email address visible to the requester.
originalFilename string The original filename used to create this revision. This is only applicable to files with binary content in Drive.
md5Checksum string The MD5 checksum of the revision's content. This is only applicable to files with binary content in Drive.
size long The size of the revision's content in bytes. This is only applicable to files with binary content in Drive.
exportLinks.(key) string A mapping from export format to URL

Methods

delete
Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.
get
Gets a revision's metadata or content by ID.
list
Lists a file's revisions.
update
Updates a revision with patch semantics.