Skip to content
Get started

Create connection

connections.create(Literal["notion", "google-drive", "onedrive", 4 more]provider, ConnectionCreateParams**kwargs) -> ConnectionCreateResponse
POST/v3/connections/{provider}

Initialize connection and get authorization URL

ParametersExpand Collapse
provider: Literal["notion", "google-drive", "onedrive", 4 more]
One of the following:
"notion"
"google-drive"
"onedrive"
"gmail"
"github"
"web-crawler"
"s3"
container_tag: Optional[str]
maxLength100
container_tags: Optional[Sequence[str]]
document_limit: Optional[int]
minimum1
maximum10000
metadata: Optional[Dict[str, Union[str, float, bool]]]
One of the following:
str
float
bool
redirect_url: Optional[str]
ReturnsExpand Collapse
class ConnectionCreateResponse:
id: str
expires_in: str
redirects_to: Optional[str]

Create connection

import os
from supermemory import Supermemory

client = Supermemory(
    api_key=os.environ.get("SUPERMEMORY_API_KEY"),  # This is the default and can be omitted
)
connection = client.connections.create(
    provider="notion",
)
print(connection.id)
{
  "id": "id",
  "authLink": "authLink",
  "expiresIn": "expiresIn",
  "redirectsTo": "redirectsTo"
}
Returns Examples
{
  "id": "id",
  "authLink": "authLink",
  "expiresIn": "expiresIn",
  "redirectsTo": "redirectsTo"
}