Skip to main content
Everything importable from vectorshift:
from vectorshift import (
    Integration, ConnectionRequest,
    IntegrationType, ConnectionStatus, IntegrationStatus,
    IntegrationError, IntegrationNotFound, UnknownIntegrationType,
    ConnectionFailed, ConnectionExpired, ConnectionTimeout,
)

Connecting

connect

Integration.connect(
    type: IntegrationType | str,
    credentials: Optional[dict] = None,
    name: Optional[str] = None,
    open_browser: bool = True,
    scopes: Optional[str] = None,
    share: bool = False,
    link_expires_in: Optional[int] = None,
    require_org_member: bool = False,
    integration_id: Optional[str] = None,
) -> ConnectionRequest
async Integration.aconnect(
    type: IntegrationType | str,
    credentials: Optional[dict] = None,
    name: Optional[str] = None,
    open_browser: bool = True,
    scopes: Optional[str] = None,
    share: bool = False,
    link_expires_in: Optional[int] = None,
    require_org_member: bool = False,
    integration_id: Optional[str] = None,
) -> ConnectionRequest
Passing credentials= does an instant form-based create and returns a ConnectionRequest that is already ACTIVE. Otherwise (form, OAuth, or hybrid) it opens a hosted connect page and returns a request carrying a connect_url; drive it to completion with .wait(). Parameters
type
IntegrationType | str
required
The integration type. Accepts an IntegrationType, a display name ("Slack"), or a route name ("slack"). Unknown values raise UnknownIntegrationType.
credentials
Optional[dict]
default:"None"
Form credentials for a credential-capable type. When present, required fields are validated client-side and the integration is created instantly. Omit to enter them / consent in the hosted page.
name
Optional[str]
default:"None"
A custom name for this integration instance.
open_browser
bool
default:"True"
Open connect_url in the default browser. Set False on headless hosts and hand the user req.connect_url yourself.
scopes
Optional[str]
default:"None"
Space-separated OAuth scopes to request (OAuth types only).
share
bool
default:"False"
Return a long-lived shareable connect link without waiting. Combine with link_expires_in.
Shareable-link TTL in seconds.
require_org_member
bool
default:"False"
Require the person completing the connection to be a member of your org.
integration_id
Optional[str]
default:"None"
Reconnect an existing integration in place instead of creating a new one. Prefer reauth.
Returns — a ConnectionRequest.
# OAuth
integ = Integration.connect("slack").wait()

# Form — instant
integ = Integration.connect(
    "postgres",
    credentials={"host": "h", "database": "d", "username": "u", "password": "p"},
).wait()

reauth

integration.reauth(open_browser: bool = True, scopes: Optional[str] = None) -> ConnectionRequest
async integration.areauth(open_browser: bool = True, scopes: Optional[str] = None) -> ConnectionRequest
Reconnect this integration in place to refresh expired or revoked auth, keeping the same object_id. Opens the hosted page; .wait() resolves when done.
integ = Integration.fetch(id="integ_abc123")
if integ.get_status() == "unhealthy":
    integ.reauth().wait()

Managing

fetch

Integration.fetch(id: Optional[str] = None, name: Optional[str] = None) -> Integration
async Integration.afetch(id: Optional[str] = None, name: Optional[str] = None) -> Integration
Fetch by id or name — at least one is required, else ValueError.

list

Integration.list(type: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None) -> list[Integration]
async Integration.alist(type: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None) -> list[Integration]
List integrations visible to the API key’s org, optionally filtered by type (route name, e.g. "slack").

get_status

integration.get_status() -> str
async integration.aget_status() -> str
Fetch the current health status — "done", "loading", or "unhealthy" (see IntegrationStatus).

sync / resync

integration.resync() -> None
integration.sync() -> None   # alias
async integration.aresync() -> None
Trigger a global metadata resync of every vectorstore that uses this integration. Fire-and-forget; only supported for revamped integration types. See the KB resync example for the KB-aware kb.resync_integration(id) wrapper.

refresh

integration.refresh() -> Integration
async integration.arefresh() -> Integration
Re-fetch this integration’s fields from the server, mutating it in place and returning self.

delete

integration.delete() -> None
async integration.adelete() -> None
Disconnect and delete the integration.

to_dict

integration.to_dict() -> dict   # {"object_id": ..., "object_type": ...}
The serialized reference shape (object_id + object_type) a Pipeline node / Agent tool stores. The fluent builder and tool classes accept the Integration object directly — pipeline.add(name="…").integration_slack(integration=integ, …) — so you rarely call to_dict() yourself; reach for it only when building a node config by hand.

Sessions & catalogue

from_session

Integration.from_session(session_id: str) -> ConnectionRequest
async Integration.afrom_session(session_id: str) -> ConnectionRequest
Rebuild a ConnectionRequest from a persisted session_id — reconcile a delegated / share=True attempt after the original process exited.

revoke_session

Integration.revoke_session(session_id: str) -> None
async Integration.arevoke_session(session_id: str) -> None
Kill an outstanding connect-session; subsequent opens of its link expire.

types

Integration.types() -> list[IntegrationType]
The authoritative catalogue of supported types.

required_fields

Integration.required_fields(type: IntegrationType | str) -> tuple[str, ...]
Required credential field names for a credential-capable type (empty tuple for OAuth-only types).
Integration.required_fields("postgres")   # ('host', 'database', 'username', 'password')

Integration

Attributes on a fetched instance:
object_id
str
The unique id. Use to_dict() / this value to reference the integration elsewhere.
name
Optional[str]
Display / account name.
type
Optional[str]
Route name, e.g. "slack".
status
Optional[str]
Health status — see IntegrationStatus.
created_date
Optional[str]
Creation timestamp.
authorized_scopes
Optional[list[str]]
OAuth scopes granted.
allowed_actions
Optional[list[str]]
Actions this connection permits.
unhealthy
Optional[bool]
Convenience flag for a degraded connection.

ConnectionRequest

One in-flight connection attempt. OAuth requests start at INITIATED with a connect_url; form requests are born ACTIVE with the Integration already attached, so wait() returns instantly. Attributes
session_id
str
The connect-session id (aliased as .id). Persist it to reconcile later via from_session.
type
IntegrationType
The type being connected.
status
ConnectionStatus
Current session status.
connect_url
Optional[str]
The URL the user opens to consent / enter credentials.

wait

req.wait(
    timeout: float = 300.0,
    poll_interval: float = 2.0,
    on_status_change: Optional[Callable[[ConnectionStatus], None]] = None,
) -> Integration
async req.await_completion(
    timeout: float = 300.0,
    poll_interval: float = 2.0,
    on_status_change: Optional[Callable[[ConnectionStatus], None]] = None,
) -> Integration
Poll until the session is ACTIVE and return the live Integration. Raises ConnectionFailed / ConnectionExpired on a terminal bad status, and ConnectionTimeout if timeout elapses first (the attempt stays live server-side — re-open connect_url or re-poll).
req = Integration.connect("slack")
integ = req.wait(timeout=180, on_status_change=lambda s: print(s.value))

get_status

req.get_status() -> ConnectionStatus
async req.aget_status() -> ConnectionStatus
A single non-blocking poll; updates and returns req.status.

get_result

req.get_result() -> Integration
async req.aget_result() -> Integration
Return the Integration if the session is already ACTIVE; raises ConnectionFailed if not yet active. Use after a get_status() confirms ACTIVE, when you don’t want to block in wait().

Enums

IntegrationType

A StrEnum whose value is the display name. Members carry:
route_name
str (property)
URL-safe id the backend uses (e.g. IntegrationType.SLACK.route_name == "slack").
is_form_only
bool (property)
True for types that connect via credentials only (no OAuth).
auth_mode
AuthMode (property)
AuthMode.FORM when is_form_only, else AuthMode.OAUTH.
from_route(route)
classmethod
Resolve a route name back to a member; unknown routes raise UnknownIntegrationType.
Passing a route name where a display name is expected also resolves (IntegrationType("slack") works).

AuthMode

OAUTH · FORM.

ConnectionStatus

The lifecycle of a ConnectionRequest: INITIATED · PENDING · ACTIVE · FAILED · EXPIRED.

IntegrationStatus

The health of a configured integration: LOADING · DONE · UNHEALTHY.

Type catalogue

76 supported types. route_name is what you pass to connect(...) / the CLI. Auth is OAuth (browser consent), Form (credentials only — see fields below), or OAuth + form (hybrid: connect via the hosted page or by passing credentials=).
Typeroute_nameAuth
BoxboxOAuth
Google Drivegoogle-driveOAuth
Google Docsgoogle-docsOAuth
Google Sheetsgoogle-sheetsOAuth
Google Slidesgoogle-slidesOAuth
Google Calendargoogle-calendarOAuth
Google Adsgoogle-adsOAuth
Google Tasksgoogle-tasksOAuth
Google Chatgoogle-chatOAuth
Google Contactsgoogle-contactsOAuth
Google BigQuerygoogle-big-queryOAuth
Google Workspace Admingoogle-workspace-adminOAuth
Google Analyticsgoogle-analyticsOAuth
Google Cloud Storagegoogle-cloud-storageOAuth
Google Firebase Realtime DBgoogle-firebase-realtime-dbOAuth
Google Cloud Firestoregoogle-cloud-firestoreOAuth
Google Perspectivegoogle-perspectiveForm
SlackslackOAuth
AirtableairtableOAuth
NotionnotionOAuth
MicrosoftmicrosoftOAuth
SharepointsharepointOAuth
DropboxdropboxOAuth
HubspothubspotOAuth
GmailgmailOAuth
OutlookoutlookOAuth
JirajiraOAuth
ZendeskzendeskOAuth
StripestripeOAuth
ClickupclickupOAuth
DatabricksdatabricksOAuth + form
GithubgithubOAuth
AsanaasanaOAuth
DiscorddiscordOAuth
LinearlinearOAuth
TeamsteamsOAuth
TwiliotwilioForm
PostgrespostgresForm
MongoDBmongodbForm
MySQLmysqlForm
SnowflakesnowflakeForm
Microsoft SQL Servermicrosoft-sql-serverOAuth + form
Aws S3aws-s3Form
TelegramtelegramOAuth + form
RedditredditOAuth
PineconepineconeForm
XxOAuth
MailchimpmailchimpOAuth
CodacodaForm
OpenweathermapopenweathermapOAuth + form
ElasticsearchelasticsearchForm
TrellotrelloOAuth
MondaymondayOAuth
SalesforcesalesforceOAuth
TypeformtypeformOAuth
Microsoft Calendarmicrosoft-calendarOAuth
Microsoft Excelmicrosoft-excelOAuth
ZoomzoomOAuth
ServicenowservicenowOAuth
GitlabgitlabOAuth
ApifyapifyForm
SupabasesupabaseForm
Oracle Databaseoracle-databaseForm
Microsoft Dynamics CRMmicrosoft_dynamics_crmOAuth
ZohozohoOAuth
QuickBooksquickbooksOAuth
IntercomintercomOAuth
PowerbipowerbiOAuth
YoutubeyoutubeOAuth
DatadogdatadogForm
Pager Dutypager-dutyOAuth
DocusigndocusignOAuth
FigmafigmaOAuth
SmartsheetsmartsheetOAuth
Sec Edgarsec-edgarForm
FredfredForm

Credential fields

Types you can connect by passing credentials=. Required fields are validated client-side (MissingCredentials); optional fields tune the connection.
TypeRequiredOptional
postgreshost, database, username, passwordport, ssl_mode
mysqlhost, database, username, passwordport, connect_timeout, ssl, ca_certificate, client_certificate, client_private_key, ssh_tunnel, ssh_host
microsoft-sql-serverserver, database, username, passwordport, domain, use_tls, ignore_ssl_issues, connect_timeout, request_timeout, tds_version
mongodbdatabase, connection_uri
snowflakeusername, password, account, role
oracle-databaseuser, password, connection_stringuse_ssl, wallet_password, wallet_content
supabasehost, service_role_secret
aws-s3access_key_id, secret_access_keyregion, bucket_name
databricksworkspace_url, access_token
pineconeapi_keyregion, environment
elasticsearchapi_key_id, api_key_secret, base_url
datadogapi_key, urlapp_key
telegrambot_token
twilioapi_key_sid, api_key_secret, account_sid, phone_number
apifyapi_key
codaapi_key
openweathermapapi_key
google-perspectiveapi_key
fredapi_key
sec-edgaruse_account_infouser_name, contact_email

Errors

All inherit from IntegrationError (itself a VectorshiftError).
IntegrationNotFound
exception
A lookup returned no result.
UnknownIntegrationType
exception
A type / route name is not in the catalogue. Carries .value.
MissingCredentials
exception
A form connect is missing required fields. Carries .type and .missing_fields. Raised client-side before any network call.
ConnectionFailed
exception
The provider denied access or the backend errored. Carries .reason.
ConnectionExpired
exception
The connect-session TTL elapsed before completion.
ConnectionTimeout
exception
wait() exceeded its timeout. Not a failure — the attempt is still live; re-open .connect_url or re-poll. Carries .connect_url, .last_status, .timeout. Also a TimeoutError.
from vectorshift import Integration, ConnectionTimeout, ConnectionFailed, MissingCredentials

try:
    integ = Integration.connect("slack").wait(timeout=120)
except ConnectionTimeout as e:
    print(f"still pending — resume at {e.connect_url}")
except ConnectionFailed as e:
    print(f"denied: {e.reason}")
except MissingCredentials as e:
    print(f"{e.type} needs {e.missing_fields}")
See Errors for the full SDK exception hierarchy.

What’s next

CLI reference

The vectorshift command line.

Integration tools

Per-service agent tool actions.

Integration nodes

Per-service pipeline node actions.