@devries-cameron20 / composio-1 / commits / 88dc00658
Fork 0

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

Sushmithamallesh committed Dec 14, 2025 at 17:41 UTC 88dc00658fa1aa1beb92fce642f73d224056a3a3
2 files changed +21 -3
fern/fern.config.json
+1 -1
@@ -1,4 +1,4 @@
1 {
2 "organization": "composio",
3 - "version": "0.116.0"
3 + "version": "3.19.0"
4 }
fern/pages/src/tool-router/managing-multiple-accounts.mdx
+20 -2
@@ -10,6 +10,7 @@ Users can connect multiple accounts for the same toolkit (e.g., personal and wor
10 ## Default account behavior
11
12 When multiple accounts are connected for the same toolkit:
13 +- Each session can only use **one account per toolkit** at a time
14 - Tool Router uses the **most recently connected account** by default
15 - You can override this by explicitly selecting an account
16 - Each account maintains its own authentication and permissions
@@ -57,29 +58,46 @@ Store the account IDs returned after connection to explicitly select accounts la
58
59 ## Selecting a specific account for a session
60
60 -To use a specific account in a session, pass it in the session config:
61 +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:
62
63 <CodeGroup>
64 ```python
65 +# This session will use a specific Gmail account
66 session = composio.create(
67 user_id="user_123",
68 connected_accounts={
69 "gmail": "ca_specific_account_id", # Connected account ID
70 },
71 )
72 +
73 +# To switch accounts, create a new session with a different account ID
74 +session2 = composio.create(
75 + user_id="user_123",
76 + connected_accounts={
77 + "gmail": "ca_different_account_id", # Different account
78 + },
79 +)
80 ```
81 ```typescript
82 +// This session will use a specific Gmail account
83 const session = await composio.create("user_123", {
84 connectedAccounts: {
85 gmail: "ca_specific_account_id", // Connected account ID
86 },
87 });
88 +
89 +// To switch accounts, create a new session with a different account ID
90 +const session2 = await composio.create("user_123", {
91 + connectedAccounts: {
92 + gmail: "ca_different_account_id", // Different account
93 + },
94 +});
95 ```
96 </CodeGroup>
97
98 ## Listing all user accounts
99
82 -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.
100 +To list all accounts a user has connected (not just the active one), see [List accounts](/docs/connected-accounts#list-accounts).
101
102 ## Viewing session's active account
103