Skip to content

Gmail

Copy page

Imports email messages and threads from a connected Google account so an assistant can answer from what your inbox already knows.

Shape: OAuth redirect. Provider id: gmail.

Workspace → Setup → Connectors → Gmail → Connect, or start the flow over the API and open the returned authUrl:

Terminal window
curl -X POST https://api.divinci.app/api/v1/connectors/gmail/auth \
-H "Authorization: Bearer $DIVINCI_API_KEY" -H "Content-Type: application/json" -d '{}'

gmail.readonly, plus userinfo.email and userinfo.profile. Read-only — Divinci cannot send, delete or modify mail through this connector.

Two filters are available on the connection:

  • A Gmail search query — the same syntax as the Gmail search box (from:billing@ has:attachment newer_than:1y), applied as the sync filter.
  • A label — restrict to one labelId.

Gmail pushes via a users.watch channel (backed by a Cloud Pub/Sub topic on our side), registered per connection and renewed before it lapses. Failed registration degrades to polling at the connection's cadence.

Terminal window
divinci connectors status gmail
divinci connectors settings gmail --auto-sync on --cadence 1440
divinci connectors disconnect gmail

Sync itself runs from the Connectors page — the CLI and v1 API sync routes cover web_crawl and wordpress only.