63
Get toolkit connection states for the session.
64
65
```python
66
-def toolkits(toolkits: List[str | None] = ..., next_cursor: str | None = ..., limit: int | None = ..., is_connected: bool | None = ..., search: str | None = ...) -> ToolkitConnectionsDetails
66
+def toolkits(toolkits: List[str] | None = ..., next_cursor: str | None = ..., limit: int | None = ..., is_connected: bool | None = ..., search: str | None = ...) -> ToolkitConnectionsDetails
67
```
68
69
**Parameters**
70
71
| Name | Type |
72
|------|------|
73
-| `toolkits?` | `List[str \| None]` |
73
+| `toolkits?` | `List[str] \| None` |
74
| `next_cursor?` | `str \| None` |
75
| `limit?` | `int \| None` |
76
| `is_connected?` | `bool \| None` |
108
Execute a tool within the session. For custom tools, accepts the full slug (e.g. "LOCAL_GREP") or the original slug (e.g. "GREP") when that original slug is unique across the session's custom tools and toolkits. Custom tools are executed in-process; remote tools are sent to the Composio backend.
109
110
```python
111
-def execute(tool_slug: str, arguments: Dict[str, Any | None] = ..., account: str | None = ..., input_responses: Dict[str, ToolRouterInputResponse | None] = ..., request_state: str | None = ...) -> ToolRouterSessionExecuteResponse
111
+def execute(tool_slug: str, arguments: Dict[str, Any] | None = ..., account: str | None = ..., input_responses: Dict[str, ToolRouterInputResponse] | None = ..., request_state: str | None = ...) -> ToolRouterSessionExecuteResponse
112
```
113
114
**Parameters**
116
| Name | Type |
117
|------|------|
118
| `tool_slug` | `str` |
119
-| `arguments?` | `Dict[str, Any \| None]` |
119
+| `arguments?` | `Dict[str, Any] \| None` |
120
| `account?` | `str \| None` |
121
-| `input_responses?` | `Dict[str, ToolRouterInputResponse \| None]` |
121
+| `input_responses?` | `Dict[str, ToolRouterInputResponse] \| None` |
122
| `request_state?` | `str \| None` |
123
124
**Returns**
137
Execute a Composio meta tool (`COMPOSIO_*`) within the session. `execute` also runs meta tools. This method only accepts meta tool slugs, so a typo is a type error instead of a failed request. The call is sent to the Composio backend as is: custom tools named in a `COMPOSIO_MULTI_EXECUTE_TOOL` call are not run in-process here.
138
139
```python
140
-def execute_meta(slug: ToolRouterSessionMetaToolSlug, arguments: Dict[str, Any | None] = ..., input_responses: Dict[str, ToolRouterInputResponse | None] = ..., request_state: str | None = ...) -> ToolRouterSessionExecuteResponse
140
+def execute_meta(slug: ToolRouterSessionMetaToolSlug, arguments: Dict[str, Any] | None = ..., input_responses: Dict[str, ToolRouterInputResponse] | None = ..., request_state: str | None = ...) -> ToolRouterSessionExecuteResponse
141
```
142
143
**Parameters**
145
| Name | Type |
146
|------|------|
147
| `slug` | `ToolRouterSessionMetaToolSlug` |
148
-| `arguments?` | `Dict[str, Any \| None]` |
149
-| `input_responses?` | `Dict[str, ToolRouterInputResponse \| None]` |
148
+| `arguments?` | `Dict[str, Any] \| None` |
149
+| `input_responses?` | `Dict[str, ToolRouterInputResponse] \| None` |
150
| `request_state?` | `str \| None` |
151
152
**Returns**
243
Proxy an API call through Composio's auth layer.
244
245
```python
246
-def proxy_execute(toolkit: str, endpoint: str, method: Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], body: Any = ..., parameters: List[Dict[str, Any | None]] = ...) -> ToolRouterSessionProxyExecuteResponse
246
+def proxy_execute(toolkit: str, endpoint: str, method: Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH'], body: Any = ..., parameters: List[Dict[str, Any]] | None = ...) -> ToolRouterSessionProxyExecuteResponse
247
```
248
249
**Parameters**
254
| `endpoint` | `str` |
255
| `method` | `Literal['GET', 'POST', 'PUT', 'DELETE', 'PATCH']` |
256
| `body?` | `Any` |
257
-| `parameters?` | `List[Dict[str, Any \| None]]` |
257
+| `parameters?` | `List[Dict[str, Any]] \| None` |
258
259
**Returns**
260
271
Partially update the session configuration. Only the fields provided are changed; omitted fields are preserved. For each policy block `None` removes the stored override (which can increase access: `toolkits=None` restores the unrestricted default, while `toolkits={"enable": []}` denies every app toolkit and is sent as-is). Supplied `tools`, `auth_configs` and `connected_accounts` maps replace the stored map entirely. Inside `manage_connections`, `callback_url=None` removes only the stored callback URL. Experimental `instant` accepts `False` to disable billed access or an object to set its filters; it does not accept `None`. Any object, even one that only sets `return_instant_charge` or `return_prices_in_search`, re-enables Instant usage on a Session set to `False`. `proxy_execute` takes a bool or `{"enable": bool}`; `True` exposes the `COMPOSIO_PROXY_EXECUTE` meta tool, `False` also turns off the sandbox `proxy_execute()` helper, and `None` removes the stored block. `hooks` replaces the whole list of hooks, and `None` removes every hook. `hooks` cannot be combined with `experimental={'session_config_id': ...}` (`hooks=None` counts). By default the request carries no precondition: the last writer wins. Pass `expected_config_version` (for example this object's `config_version`) to make the update conditional: the API then applies it only when the stored version still matches, and a concurrent change raises `SessionConfigConflictError` (HTTP 409) instead of being overwritten. The API must support the `expected_config_version` field; otherwise it rejects the request with a 400. `expected_config_version=False` is the same as omitting it. The PATCH is never retried by the transport, so a 409 is reported exactly once. On conflict this object stays unchanged: re-fetch the session with `composio.sessions.use(session_id)` and retry against the fresh `config_version`. `config`, `config_version` and `preload` are refreshed in place only after a successful response, and the updated `config` is returned. `workbench` is a backwards-compatible alias for `sandbox`. Prefer `sandbox` in new code. All other parameters use the same types as the generated `client.tool_router.session.patch()` method.
272
273
```python
274
-def update(toolkits: Union[session_patch_params.Toolkits | None, 'Omit'] = ..., instant: Union[Literal[False], ToolRouterInstantConfig, 'Omit'] = ..., tools: Union[Dict[str, session_patch_params.Tools | None], 'Omit'] = ..., tags: Union[session_patch_params.Tags | None, 'Omit'] = ..., auth_configs: Union[Dict[str, str | None], 'Omit'] = ..., connected_accounts: Union[Dict[str, SequenceNotStr[str | None]], 'Omit'] = ..., manage_connections: Union[session_patch_params.ManageConnections | None, ToolRouterUpdateManageConnectionsConfig | None, 'Omit'] = ..., sandbox: Union[session_patch_params.Workbench | None, 'Omit'] = ..., workbench: Union[session_patch_params.Workbench | None, 'Omit'] = ..., multi_account: Union[session_patch_params.MultiAccount | None, ToolRouterUpdateMultiAccountConfig | None, 'Omit'] = ..., proxy_execute: Union[Union[bool, ToolRouterProxyExecuteConfig | None], 'Omit'] = ..., hooks: Union[List[ToolRouterHook | None], 'Omit'] = ..., preload: Union[session_patch_params.Preload | None, 'Omit'] = ..., search: Union[session_patch_params.Search | None, 'Omit'] = ..., execute: Union[session_patch_params.Execute | None, 'Omit'] = ..., experimental: Union[session_patch_params.Experimental | None, ToolRouterUpdateExperimentalConfig | None, 'Omit'] = ..., expected_config_version: Union[int, None, Literal[False]] = ...) -> ToolRouterSessionConfig
274
+def update(toolkits: Union[session_patch_params.Toolkits | None, 'Omit'] = ..., instant: Union[Literal[False], ToolRouterInstantConfig, 'Omit'] = ..., tools: Union[Dict[str, session_patch_params.Tools] | None, 'Omit'] = ..., tags: Union[session_patch_params.Tags | None, 'Omit'] = ..., auth_configs: Union[Dict[str, str] | None, 'Omit'] = ..., connected_accounts: Union[Dict[str, SequenceNotStr[str]] | None, 'Omit'] = ..., manage_connections: Union[session_patch_params.ManageConnections | None, ToolRouterUpdateManageConnectionsConfig | None, 'Omit'] = ..., sandbox: Union[session_patch_params.Workbench | None, 'Omit'] = ..., workbench: Union[session_patch_params.Workbench | None, 'Omit'] = ..., multi_account: Union[session_patch_params.MultiAccount | None, ToolRouterUpdateMultiAccountConfig | None, 'Omit'] = ..., proxy_execute: Union[Union[bool, ToolRouterProxyExecuteConfig] | None, 'Omit'] = ..., hooks: Union[List[ToolRouterHook] | None, 'Omit'] = ..., preload: Union[session_patch_params.Preload | None, 'Omit'] = ..., search: Union[session_patch_params.Search | None, 'Omit'] = ..., execute: Union[session_patch_params.Execute | None, 'Omit'] = ..., experimental: Union[session_patch_params.Experimental | None, ToolRouterUpdateExperimentalConfig | None, 'Omit'] = ..., expected_config_version: Union[int, None, Literal[False]] = ...) -> ToolRouterSessionConfig
275
```
276
277
**Parameters**
280
|------|------|
281
| `toolkits?` | `Union[session_patch_params.Toolkits \| None, 'Omit']` |
282
| `instant?` | `Union[Literal[False], ToolRouterInstantConfig, 'Omit']` |
283
-| `tools?` | `Union[Dict[str, session_patch_params.Tools \| None], 'Omit']` |
283
+| `tools?` | `Union[Dict[str, session_patch_params.Tools] \| None, 'Omit']` |
284
| `tags?` | `Union[session_patch_params.Tags \| None, 'Omit']` |
285
-| `auth_configs?` | `Union[Dict[str, str \| None], 'Omit']` |
286
-| `connected_accounts?` | `Union[Dict[str, SequenceNotStr[str \| None]], 'Omit']` |
285
+| `auth_configs?` | `Union[Dict[str, str] \| None, 'Omit']` |
286
+| `connected_accounts?` | `Union[Dict[str, SequenceNotStr[str]] \| None, 'Omit']` |
287
| `manage_connections?` | `Union[session_patch_params.ManageConnections \| None, ToolRouterUpdateManageConnectionsConfig \| None, 'Omit']` |
288
| `sandbox?` | `Union[session_patch_params.Workbench \| None, 'Omit']` |
289
| `workbench?` | `Union[session_patch_params.Workbench \| None, 'Omit']` |
290
| `multi_account?` | `Union[session_patch_params.MultiAccount \| None, ToolRouterUpdateMultiAccountConfig \| None, 'Omit']` |
291
-| `proxy_execute?` | `Union[Union[bool, ToolRouterProxyExecuteConfig \| None], 'Omit']` |
292
-| `hooks?` | `Union[List[ToolRouterHook \| None], 'Omit']` |
291
+| `proxy_execute?` | `Union[Union[bool, ToolRouterProxyExecuteConfig] \| None, 'Omit']` |
292
+| `hooks?` | `Union[List[ToolRouterHook] \| None, 'Omit']` |
293
| `preload?` | `Union[session_patch_params.Preload \| None, 'Omit']` |
294
| `search?` | `Union[session_patch_params.Search \| None, 'Omit']` |
295
| `execute?` | `Union[session_patch_params.Execute \| None, 'Omit']` |