This API reference is organized by resource type. Each resource type has one or more data representations and one or more methods.
Resource types
- Files
- About
- Changes
- Children
- Parents
- Permissions
- Revisions
- Apps
- Comments
- Replies
- Properties
- Channels
- Realtime
- Teamdrives
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 by ID. |
| insert |
POST
and POST /files
|
Insert a new file. |
| patch |
PATCH /files/fileId
|
Updates file metadata. This method supports patch semantics. |
| update |
PUT
and PUT /files/fileId
|
Updates file metadata and/or content. |
| copy |
POST /files/fileId/copy
|
Creates a copy of the specified file. |
| 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 Team 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 Team Drive files. |
| untrash |
POST /files/fileId/untrash
|
Restores a file from the trash. |
| watch |
POST /files/fileId/watch
|
Start watching for changes to a file. |
| 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 requests. |
| export |
GET /files/fileId/export
|
Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.
Required query parameters:
mimeType |
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 Team 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 Team Drive. |
| get |
GET /files/fileId/permissions/permissionId
|
Gets a permission by ID. |
| insert |
POST /files/fileId/permissions
|
Inserts a permission for a file or Team Drive. |
| list |
GET /files/fileId/permissions
|
Lists a file's or Team 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
|
Removes a revision. |
| 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. This method supports patch semantics. |
| 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. This method supports patch semantics. |
| 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. This method supports patch semantics. |
| 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. |
Realtime
For Realtime 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/realtime
|
Exports the contents of the Realtime API data model associated with this file as JSON. |
| update |
PUT
|
Overwrites the Realtime API data model associated with this file with the provided JSON data model. |
Teamdrives
For Teamdrives 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 /teamdrives/teamDriveId
|
Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. |
| get |
GET /teamdrives/teamDriveId
|
Gets a Team Drive's metadata by ID. |
| insert |
POST /teamdrives
|
Creates a new Team Drive.
Required query parameters:
requestId |
| list |
GET /teamdrives
|
Lists the user's Team Drives. |
| update |
PUT /teamdrives/teamDriveId
|
Updates a Team Drive's metadata |