supermemory/apps/docs/v5/api-reference/connectors.mdx
sohamd22 2a546ff654 docs(connectors): align connector docs with the v5 API (#1812)
Fixes connector docs.

- **`authorization.url` examples.** They now show the URL the API actually returns (`/v3/connections/auth/redirect?state=…`), not provider URLs.
- **Broken examples:**
  - TS `connectors.create` examples were missing commas.
  - Python dicts now use the SDK's snake_case keys.
  - `connector.createdAt` → `connector.system.createdAt`.
  - The list default `limit` is 10.
- **Pending connectors.** They are visible through get (`pending_authorization`), just not in list.
- **Gmail:**
  - It needs the Max plan.
  - Nothing syncs until labels are picked.
  - The watch covers the selected labels, not just INBOX.
  - `from` filters use `contains`.
- **Smaller fixes:**
  - The OAuth redirect-URI troubleshooting.
  - Notion property metadata keys.
  - Picker error codes.

Checked against the current API and the published SDKs (TS 5.0.1, Python 5.0.0). Legacy v3/v4 docs are unchanged apart from factual fixes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-10-15 18:52:41 +00:00

54 lines
2.6 KiB
Text

---
title: "Connectors"
sidebarTitle: "Overview"
description: "Sync Notion, Google Drive, Gmail, GitHub, websites, S3 buckets, and Granola into a namespace"
icon: "/icons/hugeicons/book-open-01.svg"
---
| Operation | Purpose |
| --- | --- |
| `POST /ns/{namespace}/connectors` | Connect a source to this namespace. OAuth providers return an `authorization` link to send the user to; config providers start syncing right away |
| `GET /ns/{namespace}/connectors` | List the connectors feeding this namespace |
| `GET /ns/{namespace}/connectors/{id}` | Read one connector, with `include=syncs` for recent sync runs or `include=picker` for a hosted picker link |
| `PATCH /ns/{namespace}/connectors/{id}` | Change what it syncs: `selection` and `documentLimit` |
| `POST /ns/{namespace}/connectors/{id}/sync` | Trigger a sync now. Returns 409 while one is already running |
| `DELETE /ns/{namespace}/connectors/{id}` | Disconnect, optionally deleting the documents it imported |
| `GET /connectors` | List connectors across every namespace this key can read |
Providers: `notion`, `google-drive`, `onedrive`, `gmail`, `github` authenticate with OAuth. `web-crawler`, `s3`, and `granola` take their configuration in the create body and need no login.
<CodeGroup>
```typescript TypeScript
import { Supermemory } from "supermemory"
const supermemory = new Supermemory({ apiKey: process.env.SUPERMEMORY_API_KEY })
// OAuth provider: send the user to authorization.url, the connector appears once they finish
const { id, authorization } = await supermemory.connectors.create("user_123", {
provider: "notion",
redirectUrl: "https://yourapp.com/connected"
})
// Config provider: starts syncing immediately, authorization is null
const crawler = await supermemory.connectors.create("user_123", {
provider: "web-crawler",
config: { startUrl: "https://docs.example.com" },
documentLimit: 200,
})
const status = await supermemory.connectors.get("user_123", crawler.id, { include: "syncs" })
```
```bash cURL
curl -X POST "https://api.supermemory.ai/ns/user_123/connectors" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "provider": "notion", "redirectUrl": "https://yourapp.com/connected" }'
```
</CodeGroup>
<Note>
A pending OAuth connector is not returned by list until the user completes authorization. Get still returns it, with `system.status: "pending_authorization"`. The `authorization.url` expires after one hour (see `authorization.expiresAt`).
</Note>
See the [connector guides](/connectors/overview) for per-provider setup, selection rules, and troubleshooting.