Required Scopes
To configure a Sync for Google Drive, you need to request the following scopes from your Google OAuth application. Scopes tagged Permissions Sync are only needed if you use the Permissions API.Account Requirements
The Permissions API is generally used when an IT administrator connects on behalf of an organization and your application needs to check which users can access the synced files.- Workspace admin connections: Use an account with access to the files being synced and the Admin SDK groups, membership, and audit data required by your permission sync. Being an administrator does not automatically grant access to every file in Drive.
-
Non-admin Workspace connections: Permission syncing also supports regular users through the People and Cloud Identity APIs. The connected account must be able to see the relevant files, directory entries, and group memberships. OAuth scopes do not override the organization’s directory or group visibility settings, and Admin SDK operations can still return
403for these accounts.Enable Contact sharing for directory lookups
For Workspace directory lookups, ask the organization’s administrator to enable Contact sharing in the Google Admin console under Directory > Directory settings > Sharing settings. See Google’s Turn Directory on or off instructions.Group membership must also be visible to the connected account. Review Google’s Cloud Identity Groups API setup requirements with the organization’s administrator.
Contact sharing is disabled in this example. Select Enable contact sharing, then Save.
- Personal Google accounts: File syncing is available, but Workspace directory and organization-wide membership requirements do not apply to personal accounts.
Enable Google APIs
In the Google Cloud Console, select the project that owns the OAuth client configured in Paragon. Navigate to APIs & Services > Library, search for each applicable API below, and select Enable:
Enable each API from its Google Cloud API Library page. Google Drive API is shown here.
Synced Objects
Google Drive supports the following Synced Objects:- Files
Google Docs, Sheets, and Slides will be synced as their Office-compatible equivalent formats:
- Docs: DOCX file
- Sheets: XLSX file
- Slides: PPTX file
- Drawings: PDF file
- Permissions
Files
Send a request to Enable Sync to start a file sync. Syncs for Google Drive can be created with one of the following configurations:- Global Sync: All files in the user’s Google Drive account will be synced.
- Folder Sync: Only files in the specified folder will be synced (recursively including all subfolders by default).
- Sync of specific files: Only a group of specific files will be synced.
- Global Sync
- Folder Sync
- Sync of specific files
Example
An optional array of MIME types to filter synced files. Only files matching the specified MIME types will be synced.
An optional RE2 regular expression that filters synced files by filename. Only files whose name matches the pattern are synced. Folders are always traversed regardless of the pattern.Matching is unanchored and case-sensitive. Use the inline
(?i) flag for case-insensitive matches, and anchors (^, $) for exact-name matches. Lookarounds and backreferences are not supported. Patterns are limited to 1000 characters.Example: (?i)\.pdf$ syncs only PDF files.Choosing Files and Folders
You can allow your user to select files from their Google Drive account in your app with the Google Drive File Picker provided by the Paragon SDK.
- In your Google Cloud Console dashboard, navigate to APIs & Services > Library in the sidebar for your app.
- Search for “Google Picker API” from the API Library.
- Select the “Google Picker API” and press the blue “Enable” button to enable the API for your application.

- Navigate to Google Cloud Console > APIs & Services > Credentials. Make sure the selected project in the header is your app.
- Click Create Credentials and select API key.
- An API key value will appear. Copy this value to use in Showing the File Picker.

- Application restrictions: Websites with your origin/domain
- API restrictions: Google Drive API
Showing the File Picker
Use the Paragon SDK in your frontend application to show the File Picker in your app. The SDK provides anExternalFilePicker class to load Google’s JavaScript into your page and authenticate with your user’s connected Google Drive account.
To initialize the picker you will need your Google Drive API key and your Google Cloud project number. The Google Cloud project number is a unique, numerical identifier for your project. You can find it within the Google Cloud Console from the sidebar navigation under IAM & Admin section > Settings.