Skip to content

Google Drive

Copy page

Ingests documents and folders from a connected Google account. Drive is one of the four providers that gets real-time push notifications, so a changed file is picked up without waiting for the next poll.

Shape: OAuth redirect. Provider id: google_drive.

A human has to click Allow, so connecting starts in the web app: Workspace → Setup → Connectors → Google Drive → Connect.

Headlessly you can still start the flow — the API hands back the URL to open:

Terminal window
curl -X POST https://api.divinci.app/api/v1/connectors/google_drive/auth \
-H "Authorization: Bearer $DIVINCI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"returnUrl":"https://app.divinci.app/…"}'
# → { "authUrl": "https://accounts.google.com/o/oauth2/v2/auth?…", "provider": "google_drive" }

Requires an API key with the connector:write scope.

drive.readonly, drive.metadata.readonly, plus userinfo.email and userinfo.profile to label the connection. Read-only — Divinci never writes to your Drive.

Non-trashed files the connected account can see. Selection happens on the Connectors page: browse or search Drive, pick files or folders, choose the pipeline (rag, or rag + fine-tuning), and sync.

Drive changes arrive over a Google changes.watch push channel registered per connection. Those channels expire after hours-to-days, so Divinci persists the expiry and renews any channel within 12 hours of lapsing. If registration or renewal fails, the connection falls back to polling at its configured cadence — slower syncs, never no syncs.

Terminal window
divinci connectors status google_drive
divinci connectors settings google_drive --auto-sync on --cadence 1440
divinci connectors sync-status <connectionId>
divinci connectors disconnect google_drive

disconnect revokes the token at Google as well as marking the connection revoked here.