Skip to main content
Connect Google Drive to sync documents into your Supermemory knowledge base with OAuth authentication and custom app support.

Sync scope

Default for new connectors: after OAuth, the user completes a folder and file picker (Google Docs, Sheets, Slides, and PDFs). Only items they select are synced and updated until they change the selection (for example from the Supermemory console). Whole Drive: set config.syncScope to "full" when creating the connector so the entire Drive syncs without the picker. Explicit scoped mode: set config.syncScope to "selected" for the picker flow, or rely on the default for new connects.
If you use scoped sync and the user has not finished the picker yet, scheduled or manual sync may skip that connector until a selection is saved on the connector.

Quick setup

1. Create Google Drive Connector

For whole Drive sync, send "config": { "syncScope": "full" } on the same POST /ns/{namespace}/connectors request instead of "selected".

2. Handle OAuth callback

Send the user to authorization.url before authorization.expiresAt. After the user grants permissions, Google redirects through Supermemory to finish the connector. A pending OAuth connector is not visible in list or get until the user finishes authorization. With scoped sync (syncScope omitted or "selected"), the user is sent to Supermemory’s hosted file and folder picker; they must complete that step before syncs run. With syncScope: "full", Supermemory redirects to your redirectUrl without the picker. You can open the picker again later for an existing connector. Read the connector with include: "picker" and send the user to picker.url; the link works once and expires at picker.expiresAt. Pass returnUrl to choose where the picker sends the user afterwards.
If you already know the Drive file and folder ids, set them directly. A new selection replaces the old one and starts a sync.

3. Check Connector Status

There is no per-connector document list in v5. supermemory.list(namespace, "documents") returns every document in the namespace.

Supported document types

Based on the API type definitions, Google Drive documents are identified with these types:
  • google_doc - Google Docs
  • google_slide - Google Slides
  • google_sheet - Google Sheets
Drive documents are converted to markdown before ingestion. This conversion is lossy — some formatting may not be preserved.

Connector Management

List All Connectors

Delete Connector

Deleting a connector will:
  • Stop all future syncs from Google Drive
  • Remove the OAuth authorization
  • Delete the synced documents unless you pass deleteDocuments: false

Manual sync

Trigger a manual synchronization. The call returns 409 while a sync for that connector is already running.

Advanced configuration

Custom OAuth application

You can connect with your own Google OAuth app. Custom OAuth credentials are an organization setting and are not part of the v5 connector routes. See Custom OAuth Applications for the setup steps and callback URL.
Important Notes:
  • Document processing happens asynchronously
  • Use one namespace per user or tenant
  • Check latestRun.system.status and latestRun.error for failed syncs