The Drive API keeps track of all changes made to a file, and calls each change a revision, which is the record of a change that includes the recorded date, time, and user who made the change.
All revisions are tracked in a version history, which is a record of all revisions to a file in chronological order. The version is the actual file that can be reverted back to a previous version. You can use the Drive API to save revisions of a file or query the version history using the Revisions resource. To publish a file revision, see Download and publish file revisions.
Each user and shared drive has a change log that records changes. For shared drives, the change log records only changes to files in that shared drive. For more information about change logs, see Track changes for users and shared drives.
Spaces and corpora
The Drive API organizes files into storage locations called spaces, and collections called corpora.
Spaces are specific storage locations that are isolated from each other. All available content in Google Drive will be stored in one of these three defined spaces in Drive:
photos. Files cannot move between spaces.
- The default
drivespace includes all user-visible files created or stored in Google Drive. PDFs, Google Docs, Sheets, and slides, as well as any other content the user uploads is located in the
appDataFolderspace is a separate storage area for per-user application data. Applications typically store configuration files and other data not intended to be directly accessed by users.
- The default
photosspace includes all user-visible image files created or stored in Google Drive.
Corpora, like spaces, represent different collections of items and are used to direct searches. Unlike spaces, they're not isolated storage. Files within a space may move freely from one corpus to another.
The corpora in the Drive API are:
usercorpus includes all files in "My Drive" and "Shared with me"
domaincorpus includes all files shared to the user's domain that are searchable.
drivecorpus includes all files contained in a single shared drive.
allDrivescorpus includes all files in shared drives that the user is a member of and all files in "My Drive" and "Shared with me." Use of the
allSharedDrivescorpus is discouraged for efficiency reasons. Prefer 'drive' or 'user' for efficiency.
Files can move between corpora as permissions and ownership change.