> ## Documentation Index
> Fetch the complete documentation index at: https://supermemory.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connectors

> Sync Notion, Google Drive, Gmail, GitHub, websites, S3 buckets, and Granola into a namespace

| 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. Also deletes the documents it imported unless you pass `deleteDocuments=false` |
| `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.

```typescript TypeScript theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
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 theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
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" }'
```

> [!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`).

See the [connector guides](https://supermemory.ai/docs/connectors/overview.md) for per-provider setup, selection rules, and troubleshooting.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.