API Reference

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

This API reference is organized by resource type. Each resource type has one or more data representations and one or more methods.

Resource types

  1. Files
  2. About
  3. Changes
  4. Children
  5. Parents
  6. Permissions
  7. Revisions
  8. Apps
  9. Comments
  10. Replies
  11. Properties
  12. Channels
  13. Drives

Files

For Files Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
get GET  /files/fileId Gets a file's metadata or content by ID.
insert POST
https://www.googleapis.com/upload/drive/v2/files

and
POST  /files
Insert a new file.
patch PATCH  /files/fileId Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might change automatically, such as modifiedDate. This method supports patch semantics.
update PUT
https://www.googleapis.com/upload/drive/v2/files/fileId

and
PUT  /files/fileId
Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate. This method supports patch semantics.
copy POST  /files/fileId/copy Creates a copy of the specified file. Folders cannot be copied.
delete DELETE  /files/fileId Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for shared drive files.
list GET  /files Lists the user's files.
touch POST  /files/fileId/touch Set the file's updated time to the current server time.
trash POST  /files/fileId/trash Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.
untrash POST  /files/fileId/untrash Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file.
watch POST  /files/fileId/watch Subscribes to changes to a file. While you can establish a channel for changes to a file on a shared drive, a change to a shared drive file won't create a notification.
emptyTrash DELETE  /files/trash Permanently deletes all of the user's trashed files.
generateIds GET  /files/generateIds Generates a set of file IDs which can be provided in insert or copy requests.
export GET  /files/fileId/export Exports a Google Workspace document to the requested MIME type and returns exported byte content. Note that the exported content is limited to 10MB.

Required query parameters: mimeType

listLabels GET  /files/fileId/listLabels Lists the labels on a file.
modifyLabels POST  /files/fileId/modifyLabels Modifies the set of labels on a file.

About

For About Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
get GET  /about Gets the information about the current user along with Drive API settings

Changes

For Changes Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
get GET  /changes/changeId Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes.
list GET  /changes Lists the changes for a user or shared drive.
watch POST  /changes/watch Watch for all changes to a user's Drive.
getStartPageToken GET  /changes/startPageToken Gets the starting pageToken for listing future changes.

Children

For Children Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/folderId/children/childId Removes a child from a folder.
get GET  /files/folderId/children/childId Gets a specific child reference.
insert POST  /files/folderId/children Inserts a file into a folder.
list GET  /files/folderId/children Lists a folder's children. To list all children of the root folder, use the alias root for the folderId value.

Parents

For Parents Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/parents/parentId Removes a parent from a file.
get GET  /files/fileId/parents/parentId Gets a specific parent reference.
insert POST  /files/fileId/parents Adds a parent folder for a file.
list GET  /files/fileId/parents Lists a file's parents.

Permissions

For Permissions Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/permissions/permissionId Deletes a permission from a file or shared drive.
get GET  /files/fileId/permissions/permissionId Gets a permission by ID.
insert POST  /files/fileId/permissions Inserts a permission for a file or shared drive.
list GET  /files/fileId/permissions Lists a file's or shared drive's permissions.
patch PATCH  /files/fileId/permissions/permissionId Updates a permission using patch semantics.
update PUT  /files/fileId/permissions/permissionId Updates a permission.
getIdForEmail GET  /permissionIds/email Returns the permission ID for an email address.

Revisions

For Revisions Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/revisions/revisionId 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 GET  /files/fileId/revisions/revisionId Gets a specific revision.
list GET  /files/fileId/revisions Lists a file's revisions.
patch PATCH  /files/fileId/revisions/revisionId Updates a revision.
update PUT  /files/fileId/revisions/revisionId Updates a revision.

Apps

For Apps Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
list GET  /apps Lists a user's installed apps.
get GET  /apps/appId Gets a specific app.

Comments

For Comments Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/comments/commentId Deletes a comment.
get GET  /files/fileId/comments/commentId Gets a comment by ID.
insert POST  /files/fileId/comments Creates a new comment on the given file.
list GET  /files/fileId/comments Lists a file's comments.
patch PATCH  /files/fileId/comments/commentId Updates an existing comment.
update PUT  /files/fileId/comments/commentId Updates an existing comment.

Replies

For Replies Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/comments/commentId/replies/replyId Deletes a reply.
get GET  /files/fileId/comments/commentId/replies/replyId Gets a reply.
insert POST  /files/fileId/comments/commentId/replies Creates a new reply to the given comment.
list GET  /files/fileId/comments/commentId/replies Lists all of the replies to a comment.
patch PATCH  /files/fileId/comments/commentId/replies/replyId Updates an existing reply.
update PUT  /files/fileId/comments/commentId/replies/replyId Updates an existing reply.

Properties

For Properties Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /files/fileId/properties/propertyKey Deletes a property.
get GET  /files/fileId/properties/propertyKey Gets a property by its key.
insert POST  /files/fileId/properties Adds a property to a file, or updates it if it already exists.
list GET  /files/fileId/properties Lists a file's properties.
patch PATCH  /files/fileId/properties/propertyKey Updates a property.
update PUT  /files/fileId/properties/propertyKey Updates a property.

Channels

For Channels Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
stop POST  /channels/stop Stop watching for changes to a resource.

Drives

For Drives Resource details, see the resource representation page.

Method HTTP request Description
URIs relative to https://www.googleapis.com/drive/v2, unless otherwise noted
delete DELETE  /drives/driveId Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.
get GET  /drives/driveId Gets a shared drive's metadata by ID.
hide POST  /drives/driveId/hide Hides a shared drive from the default view.
insert POST  /drives Creates a new shared drive.

Required query parameters: requestId

list GET  /drives Lists the user's shared drives.
unhide POST  /drives/driveId/unhide Restores a shared drive to the default view.
update PUT  /drives/driveId Updates the metadata for a shared drive.