# Connections ## Create connection **post** `/v3/connections/{provider}` Initialize connection and get authorization URL ### Path Parameters - `provider: "notion" or "google-drive" or "onedrive" or 4 more` - `"notion"` - `"google-drive"` - `"onedrive"` - `"gmail"` - `"github"` - `"web-crawler"` - `"s3"` ### Body Parameters - `containerTag: optional string` - `containerTags: optional array of string` - `documentLimit: optional number` - `metadata: optional map[string or number or boolean]` - `string` - `number` - `boolean` - `redirectUrl: optional string` ### Returns - `id: string` - `authLink: string` - `expiresIn: string` - `redirectsTo: optional string` ### Example ```http curl https://api.supermemory.ai/v3/connections/$PROVIDER \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "id", "authLink": "authLink", "expiresIn": "expiresIn", "redirectsTo": "redirectsTo" } ``` ## Get connection (by id) **get** `/v3/connections/{connectionId}` Get connection details with id ### Path Parameters - `connectionId: string` ### Returns - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Example ```http curl https://api.supermemory.ai/v3/connections/$CONNECTION_ID \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "provider": "provider", "containerTags": [ "string" ], "documentLimit": 0, "email": "email", "expiresAt": "expiresAt", "metadata": { "foo": "bar" } } ``` ## Get connection (by provider) **post** `/v3/connections/{provider}/connection` Get connection details with provider and container tags ### Path Parameters - `provider: "notion" or "google-drive" or "onedrive" or 4 more` - `"notion"` - `"google-drive"` - `"onedrive"` - `"gmail"` - `"github"` - `"web-crawler"` - `"s3"` ### Body Parameters - `containerTags: array of string` Comma-separated list of container tags to filter connection by ### Returns - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Example ```http curl https://api.supermemory.ai/v3/connections/$PROVIDER/connection \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "containerTags": [ "user_123", "project_123" ] }' ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "provider": "provider", "containerTags": [ "string" ], "documentLimit": 0, "email": "email", "expiresAt": "expiresAt", "metadata": { "foo": "bar" } } ``` ## Delete connection by ID **delete** `/v3/connections/{connectionId}` Delete a specific connection by ID ### Path Parameters - `connectionId: string` ### Query Parameters - `deleteDocuments: optional string` Whether to also delete documents imported by this connection. Defaults to true. ### Returns - `id: string` - `provider: string` ### Example ```http curl https://api.supermemory.ai/v3/connections/$CONNECTION_ID \ -X DELETE \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` #### Response ```json { "id": "id", "provider": "provider" } ``` ## Delete connection **delete** `/v3/connections/{provider}` Delete connection for a specific provider and container tags ### Path Parameters - `provider: "notion" or "google-drive" or "onedrive" or 4 more` - `"notion"` - `"google-drive"` - `"onedrive"` - `"gmail"` - `"github"` - `"web-crawler"` - `"s3"` ### Body Parameters - `containerTags: array of string` Optional comma-separated list of container tags to filter connections by ### Returns - `id: string` - `provider: string` ### Example ```http curl https://api.supermemory.ai/v3/connections/$PROVIDER \ -X DELETE \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` #### Response ```json { "id": "id", "provider": "provider" } ``` ## Sync connection **post** `/v3/connections/{provider}/import` Initiate a manual sync of connections ### Path Parameters - `provider: "notion" or "google-drive" or "onedrive" or 4 more` - `"notion"` - `"google-drive"` - `"onedrive"` - `"gmail"` - `"github"` - `"web-crawler"` - `"s3"` ### Body Parameters - `containerTags: optional array of string` Optional comma-separated list of container tags to filter connections by ### Example ```http curl https://api.supermemory.ai/v3/connections/$PROVIDER/import \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "containerTags": [ "user_123", "project_123" ] }' ``` ## List connections **post** `/v3/connections/list` List all connections ### Body Parameters - `containerTags: optional array of string` Optional comma-separated list of container tags to filter documents by ### Returns - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Example ```http curl https://api.supermemory.ai/v3/connections/list \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "containerTags": [ "user_123", "project_123" ] }' ``` #### Response ```json [ { "id": "id", "createdAt": "createdAt", "provider": "provider", "containerTags": [ "string" ], "documentLimit": 0, "email": "email", "expiresAt": "expiresAt", "metadata": { "foo": "bar" } } ] ``` ## List documents **post** `/v3/connections/{provider}/documents` List documents indexed for a provider and container tags ### Path Parameters - `provider: "notion" or "google-drive" or "onedrive" or 4 more` - `"notion"` - `"google-drive"` - `"onedrive"` - `"gmail"` - `"github"` - `"web-crawler"` - `"s3"` ### Body Parameters - `containerTags: optional array of string` Optional comma-separated list of container tags to filter documents by ### Returns - `id: string` - `createdAt: string` - `status: string` - `summary: string` - `title: string` - `type: string` - `updatedAt: string` ### Example ```http curl https://api.supermemory.ai/v3/connections/$PROVIDER/documents \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "containerTags": [ "user_123", "project_123" ] }' ``` #### Response ```json [ { "id": "id", "createdAt": "createdAt", "status": "status", "summary": "summary", "title": "title", "type": "type", "updatedAt": "updatedAt" } ] ``` ## Configure connection **post** `/v3/connections/{connectionId}/configure` Configure resources for a connection (supported providers: GitHub for now) ### Path Parameters - `connectionId: string` ### Body Parameters - `resources: array of map[unknown]` ### Returns - `message: string` - `success: boolean` - `webhooksRegistered: optional number` ### Example ```http curl https://api.supermemory.ai/v3/connections/$CONNECTION_ID/configure \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" \ -d '{ "resources": [ { "foo": "bar" } ] }' ``` #### Response ```json { "message": "message", "success": true, "webhooksRegistered": 0 } ``` ## Fetch resources **get** `/v3/connections/{connectionId}/resources` Fetch resources for a connection (supported providers: GitHub for now) ### Path Parameters - `connectionId: string` ### Query Parameters - `page: optional number` - `parent_id: optional string` - `per_page: optional number` ### Returns - `resources: array of map[unknown]` - `total_count: optional number` ### Example ```http curl https://api.supermemory.ai/v3/connections/$CONNECTION_ID/resources \ -H "Authorization: Bearer $SUPERMEMORY_API_KEY" ``` #### Response ```json { "resources": [ { "foo": "bar" } ], "total_count": 0 } ``` ## Domain Types ### Connection Create Response - `ConnectionCreateResponse object { id, authLink, expiresIn, redirectsTo }` - `id: string` - `authLink: string` - `expiresIn: string` - `redirectsTo: optional string` ### Connection Get By ID Response - `ConnectionGetByIDResponse object { id, createdAt, provider, 5 more }` - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Connection Get By Tag Response - `ConnectionGetByTagResponse object { id, createdAt, provider, 5 more }` - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Connection Delete By ID Response - `ConnectionDeleteByIDResponse object { id, provider }` - `id: string` - `provider: string` ### Connection Delete By Provider Response - `ConnectionDeleteByProviderResponse object { id, provider }` - `id: string` - `provider: string` ### Connection Import Response - `ConnectionImportResponse = string` ### Connection List Response - `ConnectionListResponse = array of object { id, createdAt, provider, 5 more }` - `id: string` - `createdAt: string` - `provider: string` - `containerTags: optional array of string` - `documentLimit: optional number` - `email: optional string` - `expiresAt: optional string` - `metadata: optional map[unknown]` ### Connection List Documents Response - `ConnectionListDocumentsResponse = array of object { id, createdAt, status, 4 more }` - `id: string` - `createdAt: string` - `status: string` - `summary: string` - `title: string` - `type: string` - `updatedAt: string` ### Connection Configure Response - `ConnectionConfigureResponse object { message, success, webhooksRegistered }` - `message: string` - `success: boolean` - `webhooksRegistered: optional number` ### Connection Resources Response - `ConnectionResourcesResponse object { resources, total_count }` - `resources: array of map[unknown]` - `total_count: optional number`