Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

manging multiple accounts

Sushmithamallesh88dc00658fa1
diff --git a/fern/fern.config.json b/fern/fern.config.json
index da5ec9937..8ffe1d343 100644
--- a/fern/fern.config.json
+++ b/fern/fern.config.json
@@ -1,4 +1,4 @@
{
"organization": "composio",
- "version": "0.116.0"
+ "version": "3.19.0"
}
diff --git a/fern/pages/src/tool-router/managing-multiple-accounts.mdx b/fern/pages/src/tool-router/managing-multiple-accounts.mdx
index 812bf828c..105cbc2fe 100644
--- a/fern/pages/src/tool-router/managing-multiple-accounts.mdx
+++ b/fern/pages/src/tool-router/managing-multiple-accounts.mdx
@@ -10,6 +10,7 @@ Users can connect multiple accounts for the same toolkit (e.g., personal and wor
## Default account behavior
When multiple accounts are connected for the same toolkit:
+- Each session can only use **one account per toolkit** at a time
- Tool Router uses the **most recently connected account** by default
- You can override this by explicitly selecting an account
- Each account maintains its own authentication and permissions
@@ -57,29 +58,46 @@ Store the account IDs returned after connection to explicitly select accounts la
## Selecting a specific account for a session
-To use a specific account in a session, pass it in the session config:
+Each Tool Router session can only use one account per toolkit at a time. To use a specific account in a session, pass it in the session config:
<CodeGroup>
```python
+# This session will use a specific Gmail account
session = composio.create(
user_id="user_123",
connected_accounts={
"gmail": "ca_specific_account_id", # Connected account ID
},
)
+
+# To switch accounts, create a new session with a different account ID
+session2 = composio.create(
+ user_id="user_123",
+ connected_accounts={
+ "gmail": "ca_different_account_id", # Different account
+ },
+)
```
```typescript
+// This session will use a specific Gmail account
const session = await composio.create("user_123", {
connectedAccounts: {
gmail: "ca_specific_account_id", // Connected account ID
},
});
+
+// To switch accounts, create a new session with a different account ID
+const session2 = await composio.create("user_123", {
+ connectedAccounts: {
+ gmail: "ca_different_account_id", // Different account
+ },
+});
```
</CodeGroup>
## Listing all user accounts
-To list all accounts a user has connected (not just the active one), see [List accounts](/docs/connected-accounts#list-accounts) in the Connected Accounts guide.
+To list all accounts a user has connected (not just the active one), see [List accounts](/docs/connected-accounts#list-accounts).
## Viewing session's active account