Skip to main content
Selectable connectors: GitHub (repositories), Gmail (labels), Google Drive (files and folders) and OneDrive (folders) let you choose what to sync. Other connectors sync everything and return selection: null, as does a OneDrive connector set to sync the whole drive.
Some connectors let you select which resources to sync. v5 exposes this through two calls on the connector itself: read it with include: "picker" to get a hosted picker URL, or send the ids directly with connectors.update.

Open the Hosted Picker

GET /ns/{namespace}/connectors/{id}?include=picker Returns a one-time picker URL. Send the user there; Supermemory lists their resources, saves the selection and starts a sync. Pass returnUrl to choose where the picker sends the user when they finish.

Query parameters

  • include: picker for the hosted picker URL, syncs for recent sync runs, or syncs,picker for both
  • returnUrl: Optional. Where the hosted picker sends the user when they finish

Response

The picker link works once, in any browser. picker is null for providers that do not support selection. A Google Drive or OneDrive connector with whole-drive sync can still open the picker; saving a selection switches it to scoped sync. Because the link changes what syncs, include=picker needs an admin key with write access to the namespace; otherwise the request returns 403.

Set the Selection Directly

PATCH /ns/{namespace}/connectors/{id} Send the ids to sync, grouped by kind. The new selection replaces the current one and starts a sync. Webhooks are registered for the selected resources.

Request body

The selection key depends on the provider:
  • GitHub: repos (repository ids)
  • Gmail: labels (label ids, for example INBOX)
  • Google Drive: files and folders (Drive ids)
  • OneDrive: folders (OneDrive folder ids)
You can send documentLimit in the same body. Each call must include selection, documentLimit, or both.

Response

The updated connector object, including the saved selection as { id, name } pairs.

Error Responses

  • 400: Connector does not support selection, the selection is empty or has unknown ids, or the connector needs to be reconnected
  • 401: Unauthorized
  • 403: The key lacks admin role or write access to the connector’s namespaces
  • 404: Connector not found
  • 409: Connector is still waiting for the user to finish authorizing
Automatic Sync: After a selection is saved, a sync starts for the connector. You don’t need to call connectors.sync afterwards.

Example: GitHub repository selection

Here’s a complete example for GitHub: