Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
docs: add changelog for session.use(), session.update(), connectedAccounts arrays
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Abir Taheer committed
May 8, 2026 at 04:08 UTC
f4d942d791a1865bea79f9ba8f306602fe7ab9ef
1 file changed
+110
docs/content/changelog/05-08-26-session-use-update-connected-accounts.mdx
new
+110
@@ -0,0 +1,110 @@
1
+---
2
+title: "Session reuse, update, and connected accounts as arrays"
3
+description: "composio.use() rehydrates sessions for multi-turn chat, session.update() patches config in-place, and connectedAccounts now accepts arrays."
4
+date: "2026-05-08"
5
+---
6
+
7
+### Session reuse with `composio.use()`
8
+
9
+`composio.create()` now returns a new session ID on every call, even for identical configs, for better isolation and observability. For multi-turn conversations, store the session ID and reuse it with `composio.use()`:
10
+
11
+<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
12
+<Tab value="Python">
13
+```python
14
+from composio import Composio
15
+
16
+composio = Composio()
17
+
18
+# First request
19
+session = composio.create(user_id="user_123")
20
+session_id = session.session_id
21
+
22
+# Subsequent requests
23
+session = composio.use(session_id)
24
+tools = session.tools()
25
+```
26
+</Tab>
27
+<Tab value="TypeScript">
28
+```typescript
29
+import { Composio } from '@composio/core';
30
+const composio = new Composio({ apiKey: 'your_api_key' });
31
+// ---cut---
32
+// First request
33
+const session = await composio.create("user_123");
34
+const sessionId = session.sessionId;
35
+
36
+// Subsequent requests
37
+const session2 = await composio.use(sessionId);
38
+const tools = await session2.tools();
39
+```
40
+</Tab>
41
+</Tabs>
42
+
43
+Custom tools can also be attached when reusing a session. See [Reusing a session](/docs/users-and-sessions#reusing-a-session) and [Custom tools](/docs/toolkits/custom-tools-and-toolkits#reusing-a-session-with-custom-tools).
44
+
45
+### Update session config with `session.update()`
46
+
47
+Modify a session's toolkits, auth configs, connected accounts, and other settings without creating a new session. Only the fields you pass are changed:
48
+
49
+<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
50
+<Tab value="Python">
51
+```python
52
+session.update(
53
+ toolkits=["gmail", "slack"],
54
+ auth_configs={"gmail": "ac_new_config"},
55
+)
56
+```
57
+</Tab>
58
+<Tab value="TypeScript">
59
+```typescript
60
+import { Composio } from '@composio/core';
61
+const composio = new Composio({ apiKey: 'your_api_key' });
62
+const session = await composio.create("user_123");
63
+// ---cut---
64
+await session.update({
65
+ toolkits: ["gmail", "slack"],
66
+ authConfigs: { gmail: "ac_new_config" },
67
+});
68
+```
69
+</Tab>
70
+</Tabs>
71
+
72
+See [Updating a session](/docs/users-and-sessions#updating-a-session).
73
+
74
+### `connectedAccounts` accepts arrays
75
+
76
+`connectedAccounts` (TypeScript) and `connected_accounts` (Python) now accept an array of connected account IDs per toolkit. A single string is still accepted for backwards compatibility and is automatically coerced to an array.
77
+
78
+<Tabs groupId="language" items={['Python', 'TypeScript']} persist>
79
+<Tab value="Python">
80
+```python
81
+session = composio.create(
82
+ user_id="user_123",
83
+ connected_accounts={
84
+ "gmail": ["ca_work_gmail"],
85
+ },
86
+)
87
+```
88
+</Tab>
89
+<Tab value="TypeScript">
90
+```typescript
91
+import { Composio } from '@composio/core';
92
+const composio = new Composio({ apiKey: 'your_api_key' });
93
+// ---cut---
94
+const session = await composio.create("user_123", {
95
+ connectedAccounts: {
96
+ gmail: ["ca_work_gmail"],
97
+ },
98
+});
99
+```
100
+</Tab>
101
+</Tabs>
102
+
103
+Only one account per toolkit is allowed when [multi-account mode](/docs/managing-multiple-connected-accounts) is disabled.
104
+
105
+### SDK versions
106
+
107
+| SDK | Minimum version |
108
+| --- | --- |
109
+| TypeScript `@composio/core` | `0.10.0` |
110
+| Python `composio` | `0.13.0` |