Max Plan Required: The Gmail connector is available on Max plan and above.
Quick setup
1. Create Gmail Connector
- TypeScript
- Python
- cURL
2. Handle OAuth callback
Send the user toauthorization.url before authorization.expiresAt. After the user grants permissions, Google redirects to your redirectUrl and the initial sync begins. A pending OAuth connector is not visible in list or get until the user finishes authorization.
3. Check Connector Status
- TypeScript
- Python
- cURL
There is no per-connector document list in v5.
supermemory.list(namespace, "documents") returns every document in the namespace.What gets synced
Email threads
Gmail threads (conversations) are synced as individual documents with all messages included:- Thread content converted to structured markdown
- All messages within each thread preserved in order
- Message metadata: subject, from, to, cc, bcc, date
- HTML content converted to clean markdown
- Attachment metadata: filename, mime type, size (attachments are referenced, not stored)
Document metadata
Each synced thread includes searchable metadata:
You can filter searches using these metadata fields:
Connector Management
List All Connectors
- TypeScript
- Python
- cURL
Delete Connector
- TypeScript
- Python
- cURL
Deleting a connector will:
- Stop all future syncs from Gmail
- Remove the OAuth authorization
- Delete the synced documents unless you pass
deleteDocuments: false
Manual sync
Trigger a manual synchronization. The call returns409 while a sync for that connector is already running.
- TypeScript
- Python
- cURL
Sync mechanism
Gmail connector supports multiple sync methods:How real-time sync works
- When a connector is created, supermemory registers a Gmail API “watch” subscription
- Gmail sends notifications to a Google Cloud Pub/Sub topic when emails change
- supermemory receives these notifications and fetches updated threads
- Watch subscriptions expire after 7 days and are automatically renewed
Real-time sync monitors the INBOX label. Emails in other labels are synced via scheduled/manual sync.
Permissions & scopes
The Gmail connector requests the following OAuth scopes:Limitations
Troubleshooting
OAuth fails or missing refresh token
If OAuth fails or the connector stops syncing:- Delete the existing connector
- Create a new connector
- Ensure the user completes the full OAuth flow with consent
Emails not syncing in real-time
If real-time sync isn’t working:- Scheduled sync (every 4 hours) and manual sync still work
- Real-time sync requires supermemory’s Pub/Sub infrastructure
- Check if the connector was created recently (watch registration happens on creation)
- Trigger a manual sync to verify the connector is working
Permission denied errors
If you see permission errors:- Ensure the user granted the required Gmail scopes during OAuth
- Verify your organization has Max Plan or above access
- Check if the user revoked app access in their Google Account settings