Skip to main content
Connected Accounts represent authenticated connections to third-party services. The ConnectedAccounts class provides methods to create, manage, and maintain these connections.

Accessing Connected Accounts

Methods

initiate

Create a new connected account and return a connection request.
str
required
The user ID to create the connected account for.
str
required
The auth config ID to use for authentication.
str
Callback URL for OAuth redirects.
bool
default:"False"
Allow multiple connected accounts for the same user and auth config.
ConnectionState
Connection configuration (for API key, basic auth, etc.).
Create a Composio Connect Link for user authentication.

get

Retrieve a specific connected account.

list

List connected accounts with filtering.

enable

Enable a connected account.

disable

Disable a connected account.

refresh

Refresh account credentials.

delete

Delete a connected account.

wait_for_connection

Wait for a connection to become active.

Connection Request

The ConnectionRequest object is returned by initiate() and link().

Properties

str
The connected account ID.
str
Connection status (e.g., “INITIATED”, “ACTIVE”).
str | None
OAuth redirect URL for user authorization.

Methods

(timeout: float) -> ConnectedAccount
Wait for the connection to become active.

Auth Schemes

Use the auth_scheme helper to create connections with different authentication methods.

Connection Statuses

  • ACTIVE: Connection is established and working
  • INACTIVE: Connection is temporarily disabled
  • PENDING: Connection is being processed
  • INITIATED: Connection request has started
  • EXPIRED: Connection credentials have expired
  • FAILED: Connection attempt failed

Examples

OAuth Flow

API Key Authentication

List User Connections

Refresh Expired Connection

Next Steps

Auth Configs

Configure authentication

Tools

Execute tools with connections

Toolkits

Authorize toolkits