TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ComposioHQ/composio/llms.txt
Use this file to discover all available pages before exploring further.
ConnectedAccounts class manages authenticated connections between your users and external services. A connected account stores the OAuth tokens, API keys, or other credentials that Composio needs to execute tools on a user’s behalf. Each connected account belongs to a user ID and an auth config, and has a status that reflects the current authentication state.
connectedAccounts.link()
Create a Composio Connect Link — the recommended way to start an OAuth flow for Composio-managed auth configs. Returns aConnectionRequest with a redirectUrl to send the user to.
External user identifier from your database.
Auth config ID to connect. Obtain this from
composio.authConfigs.list() or the Composio dashboard.URL to redirect the user to after they complete the OAuth flow. Your server receives
?status=success or ?status=failed as a query parameter.Human-readable alias for this connection. Must be unique per
userId and toolkit within your project.Allow creating multiple connections for the same user and auth config. When
false (default), throws ComposioMultipleConnectedAccountsError if an active connection already exists.ConnectionRequest
Connected account ID. Use this to poll for connection status.
Current status — one of
INITIALIZING, INITIATED, ACTIVE, FAILED, EXPIRED, INACTIVE, or REVOKED.URL to redirect the user to for OAuth flows.
null for non-redirectable auth schemes (API key, basic auth).Polls until the connection status becomes
ACTIVE or a terminal error state. See below.connectedAccounts.initiate()
Create a connected account directly. Use this for non-OAuth auth schemes (API key, bearer token, basic auth) or custom OAuth apps. For Composio-managed OAuth, preferlink().
External user identifier.
Auth config ID to connect.
OAuth callback URL.
Pre-populated authentication credentials. Use with API key, bearer token, or basic auth configs to provide credentials at creation time without a redirect flow.
Human-readable alias for this connection.
Allow multiple connections per user per auth config. Defaults to
false.connectedAccounts.waitForConnection()
Poll until a connected account reachesACTIVE status or a terminal error state. Throws on timeout or failure.
ID of the connected account to poll.
Maximum time to wait in milliseconds. Defaults to
60000 (60 seconds).connectedAccounts.get()
Retrieve a connected account by its ID.ConnectedAccountRetrieveResponse
Unique connected account identifier.
One of
INITIALIZING, INITIATED, ACTIVE, FAILED, EXPIRED, INACTIVE, REVOKED.The toolkit this connection belongs to.
Auth config metadata including
id, authScheme, isComposioManaged, and isDisabled.The connection’s auth state (tokens, API keys, etc.).
Whether this connection has been manually disabled.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
connectedAccounts.list()
List connected accounts with optional filtering.Filter by user IDs.
Filter by toolkit slugs (e.g.
['github']).Filter by auth config IDs.
Filter by status values. Valid values:
INITIALIZING, INITIATED, ACTIVE, FAILED, EXPIRED, INACTIVE, REVOKED.Pagination cursor from a previous response.
Maximum number of results per page.
Sort field —
'created_at' or 'updated_at'.ConnectedAccountListResponse
Connected accounts for the current page.
Cursor for the next page.
null when there are no more results.Total number of pages.
connectedAccounts.delete()
Permanently delete a connected account. This action cannot be undone and revokes any associated access tokens.connectedAccounts.refresh()
Force a token refresh for a connected account. Useful when an OAuth token has expired or is about to expire.Redirect URL for re-authentication flows where the token cannot be refreshed silently.
Validate the refreshed credentials against the upstream API before returning.
connectedAccounts.update()
Enable or disable a connected account. Accepts{ enabled: boolean }. A lower-level alternative to enable() / disable() when you want to pass the flag programmatically.
Unique identifier of the connected account.
true to enable the account, false to disable it.connectedAccounts.enable() / disable()
Enable or disable a connected account without deleting it.Examples
- OAuth flow with link()
- API key auth (no redirect)
- List active connections