Skip to main content

Google Drive API

Google Drive is Google's cloud-based file storage and synchronization service, part of the Google Workspace platform. It enables individuals and organizations to store files of any type, share content securely with colleagues or external partners, and collaborate in real time. The Google Drive REST API (v3) provides programmatic access to file metadata, file content, permissions, comments, revisions, and shared drives, making it possible to build automated workflows that read from or write to Drive without manual interaction. Common use cases include exporting file listings for auditing, ingesting document content for downstream processing, uploading generated reports, and managing file permissions at scale.

Google Drive API icon

Power end-to-end data operations for your Google Drive API API with Nexla. Our bi-directional Google Drive API connector is purpose-built for Google Drive API, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Google Drive API or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Google Drive API workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Google Drive API credential in Nexla, ensure the following requirements are met.

Google Account

An active Google account with access to the Google Drive storage you want to connect is required. If you are accessing a shared drive or a drive belonging to a Google Workspace organization, ensure your account has appropriate permissions to the relevant files and folders.

Google Drive API Enabled

The Google Drive API must be enabled for the Google Cloud project associated with your OAuth 2.0 credentials. To verify or enable the API:

  1. Sign in to the Google Cloud Console.

  2. Select or create a Google Cloud project from the project selector at the top of the page.

  3. Navigate to APIs & Services > Library from the left navigation menu.

  4. Search for Google Drive API in the search box.

  5. Select Google Drive API from the results, and click Enable if it is not already enabled.

Required OAuth 2.0 Scopes

The Nexla Google Drive API connector uses OAuth 2.0 to authenticate with the Google Drive API. During the authorization process, Nexla will request the following access scopes:

  • https://www.googleapis.com/auth/drive — Full access to all files in Google Drive, including reading, creating, modifying, and deleting files and their metadata.
  • https://www.googleapis.com/auth/drive.readonly — Read-only access to file metadata and file content. Sufficient for data source use cases where no write operations are needed.

Google recommends requesting the most narrowly scoped permissions your use case requires. For read-only data ingestion workflows, the drive.readonly scope provides the minimum necessary access and reduces the permissions granted to the application.

Google Workspace Considerations

If you are using a Google Workspace (formerly G Suite) account, your organization's administrator may need to approve third-party application access before the OAuth flow can complete. If you encounter an authorization error, contact your Google Workspace administrator to ensure the Nexla application is permitted to access Google Drive data. For details, refer to Google's documentation on controlling third-party app access.

Authenticate

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

  2. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  3. Click the Authorize button to initiate the OAuth 2.0 authorization flow. A new browser window will open, directing you to the Google sign-in page.

  4. Sign in with the Google account that has access to the Google Drive storage you want to connect. If you are already signed in, select the appropriate account from the list.

  5. Review the permissions that Nexla is requesting on the consent screen, and click Allow to grant access. Google will redirect you back to Nexla once authorization is complete.

    The OAuth 2.0 authorization flow is managed entirely by Google. Nexla does not have access to your Google account password. The authorization grants Nexla a secure, scoped token that allows it to access Google Drive data on your behalf. This access can be revoked at any time from your Google Account permissions page.

  6. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Google Drive API connector tile, then select the credential that will be used to connect to the Google Drive API, and click Next; or, create a new Google Drive API credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Google Drive API endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Files List

Retrieves files and folders from Google Drive with metadata including name, type, size, and sharing info. Use this endpoint to build file inventories, audit Drive contents, or sync file metadata with downstream systems.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files with a fields parameter specifying the metadata fields to return.
  • Response data is extracted from $.files[*], treating each file or folder as a separate record.
  • Configure the following parameter: Drive Query Filter — an optional query string to filter results (e.g., mimeType='application/vnd.google-apps.folder' to return only folders, or trashed=false to exclude deleted files).

The Google Drive API v3 requires the fields query parameter to control which response fields are returned. The template pre-configures common metadata fields including id, name, mimeType, size, createdTime, and modifiedTime.

Files in Folder

Lists all files within a specific Google Drive folder. Use this endpoint to inventory the contents of a specific folder, monitor folder-level activity, or process files stored in a designated Drive location.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files with a query filter scoped to the specified folder ID.
  • Response data is extracted from $.files[*], treating each file as a separate record.
  • Configure the following parameter: Folder ID — the unique identifier of the Google Drive folder whose contents will be listed.

Folder IDs can be found in the Google Drive web app by selecting a folder and checking the URL, or retrieved from the Files List endpoint by filtering for mimeType='application/vnd.google-apps.folder'.

File Metadata

Retrieves detailed metadata for a specific file by its file ID. Use this endpoint when you need the complete metadata record for a single known file, including all available properties.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files/{'{fileId}'} and returns the full metadata object for the specified file.
  • Response data is extracted from $ (the root object), returning a single file metadata record.
  • Configure the following parameter: File ID — the unique identifier of the file for which metadata will be retrieved.

File IDs can be obtained from the Files List, Files in Folder, or Search Files endpoints. Use lookup-based macros to iterate over a list of file IDs and retrieve detailed metadata for each.

File Permissions

Retrieves sharing permissions for a specific file or folder. Use this endpoint to audit who has access to Drive files, generate sharing reports, or identify files with overly broad permissions.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files/{'{fileId}'}/permissions and returns all permission records for the specified file.
  • Response data is extracted from $.permissions[*], treating each permission entry as a separate record.
  • Configure the following parameter: File ID — the unique identifier of the file or folder for which permissions will be retrieved.

Permission records include the grantee's email, role (owner, writer, reader, commenter), and permission type (user, group, domain, anyone). This endpoint is particularly useful for security and compliance audits.

Shared Drives

Lists all available Google Shared Drives (formerly Team Drives) accessible to the authenticated user. Use this endpoint to inventory shared drive configurations or synchronize shared drive metadata with external systems.

Shared drive IDs returned by this endpoint can be used as the driveId parameter when listing files within a specific shared drive using the Files List endpoint.

File Revisions

Lists the revision history for a specific file. Use this endpoint to track document version history, audit content changes over time, or build version-aware data pipelines.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files/{'{fileId}'}/revisions and returns all revision records for the specified file.
  • Response data is extracted from $.revisions[*], treating each revision as a separate record.
  • Configure the following parameter: File ID — the unique identifier of the file for which revision history will be retrieved.

Revision history is only available for files stored in Google Docs Editors formats (Docs, Sheets, Slides, etc.). Binary files uploaded to Drive do not have a revision history accessible via this endpoint.

Drive About / User Info

Retrieves Google Drive storage quota, user info, and account details. Use this endpoint to monitor storage usage, report on quota consumption, or retrieve user identity information for the authenticated account.

Storage quota fields include limit, usage, usageInDrive, and usageInDriveTrash — all expressed in bytes.

Drive Changes (Incremental)

Tracks incremental changes to files and folders in Google Drive using a start page token. Use this endpoint for efficient ongoing synchronization that fetches only files added, modified, or deleted since the last sync.

  • Sends a GET request to https://www.googleapis.com/drive/v3/changes with a pageToken parameter identifying the point from which to retrieve changes.
  • Response data is extracted from $.changes[*], treating each change event as a separate record.
  • Configure the following parameter: Start Page Token — the page token from which to start retrieving changes. Obtain the initial token from the Drive Changes start page token endpoint before using this endpoint for the first time.

The newStartPageToken field in the response should be stored and used as the pageToken for the next incremental sync run. This is the recommended pattern for building efficient, ongoing Drive synchronization flows.

Search Files

Searches for files across Google Drive using a custom query string. Use this endpoint to locate specific files matching criteria such as file type, name pattern, owner, or modification date.

  • Sends a GET request to https://www.googleapis.com/drive/v3/files with a q query parameter containing the search expression.
  • Response data is extracted from $.files[*], treating each matching file as a separate record.
  • Configure the following parameter: Search Query — a Google Drive query string expression (e.g., name contains 'report' and mimeType='application/pdf').

Google Drive query syntax supports filtering by name, MIME type, owner, sharing settings, modification date, and more. Refer to the Google Drive search query documentation for the full list of supported operators and fields.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Google Drive API sources can also be manually configured to ingest data from any valid Google Drive REST API v3 endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

The Google Drive REST API v3 base URL is https://www.googleapis.com/drive/v3/. Common endpoints include listing files (https://www.googleapis.com/drive/v3/files), retrieving file metadata (https://www.googleapis.com/drive/v3/files/{fileId}), listing permissions (https://www.googleapis.com/drive/v3/files/{fileId}/permissions), listing comments (https://www.googleapis.com/drive/v3/files/{fileId}/comments), listing revisions (https://www.googleapis.com/drive/v3/files/{fileId}/revisions), and listing shared drives (https://www.googleapis.com/drive/v3/drives). The API requires a fields query parameter to control which response fields are returned — for example, append ?fields=files(id,name,mimeType,modifiedTime) to a files list request. Google Drive query syntax supports date-time filters such as modifiedTime > '{now-1}' using Nexla's date/time macros in RFC 3339 format, and lookup-based macros can populate path parameters like {fileId} when iterating over a list of file or folder IDs from another Nexla source.

Google Drive API responses wrap result arrays inside a named property alongside pagination metadata, so the Set Path to Data in Response field must be set explicitly — common values include $.files[*] for file listings, $.permissions[*] for permissions, $.comments[*] for comments, $.revisions[*] for revisions, and $.drives[*] for shared drives. The OAuth 2.0 Authorization header is handled automatically by Nexla based on your credential configuration and does not need to be added as a request header. For complete field and endpoint documentation, refer to the Google Drive API v3 reference.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Google Drive API data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.

Use as a destination

Click the + icon on the Nexset that will be sent to the Google Drive API destination, and select the Send to Destination option from the menu. Select the Google Drive API connector from the list of available destination connectors, then select the credential that will be used to connect to the Google Drive API, and click Next; or, create a new Google Drive API credential for use in this flow.

Manual configuration

Google Drive API destinations can be manually configured to send data to any valid Google Drive REST API v3 endpoint. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.

Common Google Drive API write methods are POST (creating files, uploading content, or adding permissions and comments), PATCH (partially updating file metadata or permissions), PUT (replacing file content), and DELETE (removing files, permissions, or comments). The Google Drive REST API v3 base URL is https://www.googleapis.com/drive/v3/ — common write endpoints include creating a file (https://www.googleapis.com/drive/v3/files), updating file metadata (https://www.googleapis.com/drive/v3/files/{fileId}), adding a permission (https://www.googleapis.com/drive/v3/files/{fileId}/permissions), and adding a comment (https://www.googleapis.com/drive/v3/files/{fileId}/comments). File IDs are alphanumeric strings visible in a file's shareable link (e.g., https://drive.google.com/file/d/{fileId}/view); use a Google Drive API data source to retrieve file IDs before referencing them in a destination.

Set the Content Format to JSON for metadata-only operations such as updating properties or adding permissions and comments. To upload file content, use the multipart upload endpoint at https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart, which combines file metadata and file content in a single request. The OAuth 2.0 Authorization header is handled automatically by Nexla based on your credential configuration and does not need to be added as a request header. For complete upload documentation, refer to the Google Drive API upload guide.

Save & activate

Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To begin sending data to the configured Google Drive API endpoint, open the destination resource menu, and select Activate.

The Nexset data will not be sent to the Google Drive API endpoint until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.