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

A revision of a file.

{
  "kind": "drive#revision",
  "etag": etag,
  "id": string,
  "selfLink": string,
  "mimeType": string,
  "modifiedDate": datetime,
  "pinned": boolean,
  "published": boolean,
  "publishedLink": string,
  "publishAuto": boolean,
  "publishedOutsideDomain": boolean,
  "downloadUrl": string,
  "exportLinks": {
    (key): string
  },
  "lastModifyingUserName": string,
  "lastModifyingUser": {
    "kind": "drive#user",
    "displayName": string,
    "picture": {
      "url": string
    },
    "isAuthenticatedUser": boolean,
    "permissionId": string,
    "emailAddress": string
  },
  "originalFilename": string,
  "md5Checksum": string,
  "fileSize": long
}
Property name Value Description Notes
kind string This is always drive#revision.
etag etag The ETag of the revision.
id string The ID of the revision.
mimeType string The MIME type of the revision.
modifiedDate datetime Last time this revision was modified (formatted RFC 3339 timestamp).
pinned boolean Whether this revision is pinned to prevent automatic purging. If not set, the revision is automatically purged 30 days after newer content is uploaded. This field can only be modified on files with content stored in Drive, excluding Docs Editors files. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. Pinned revisions are stored indefinitely using additional storage quota, up to a maximum of 200 revisions. writable
published boolean Whether this revision is published. This is only populated and can only be modified for Docs Editors files. writable
publishAuto boolean Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Docs Editors files. writable
publishedOutsideDomain boolean Whether this revision is published outside the domain. This is only populated and can only be modified for Docs Editors files. writable
downloadUrl string
exportLinks.(key) string A mapping from export format to URL
lastModifyingUserName string Name of the last user to modify this revision.
originalFilename string The original filename when this revision was created. This will only be populated on files with content stored in Drive.
md5Checksum string An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive.
fileSize long The size of the revision in bytes. This will only be populated on files with content stored in Drive.
lastModifyingUser nested object The last user to modify this revision.
lastModifyingUser.kind string This is always drive#user.
lastModifyingUser.displayName string A plain text displayable name for this user.
lastModifyingUser.picture object The user's profile picture.
lastModifyingUser.picture.url string A URL that points to a profile picture of this user.
lastModifyingUser.isAuthenticatedUser boolean Whether this user is the same as the authenticated user for whom the request was made.
lastModifyingUser.permissionId string The user's ID as visible in the permissions collection.
lastModifyingUser.emailAddress string The email address of the user.

Methods

With get, patch, and update, you can use the alias head instead of a specific revisionId to refer to the head revision.

delete
Permanently deletes a file version. You can only delete revisions for files with binary content, 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 specific revision.
list
Lists a file's revisions.
patch
Updates a revision.
update
Updates a revision.