@devries-cameron20 / composio Mirror · read-only / commits / 5241b8d44
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 11:00 UTC

docs: update Python SDK reference from source (#4574)

## Summary Auto-generated Python SDK reference docs from `python/composio/`. Regenerates pages at `docs/content/reference/sdk-reference/python/` to reflect changes in the Python package's public API (new methods, updated signatures, changed types). Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>

sdkrelease[bot] committed Sep 22, 2026 at 19:08 UTC 5241b8d44134b132b5aa99d518645effeb5bf825
3 files changed +203 -3
docs/content/reference/sdk-reference/python/connected-accounts.mdx
+86 -1
@@ -5,6 +5,91 @@ description: "Manage connected accounts. This class is used to manage connected
5
6 ## Methods
7
8 +### refresh()
9 +
10 +Refresh the credentials of a connected account.
11 +
12 +```python
13 +def refresh(nanoid: str, params: connected_account_refresh_params.ConnectedAccountRefreshParams = ...) -> connected_account_refresh_response.ConnectedAccountRefres...
14 +```
15 +
16 +**Parameters**
17 +
18 +| Name | Type |
19 +|------|------|
20 +| `nanoid` | `str` |
21 +| `params?` | `connected_account_refresh_params.ConnectedAccountRefreshParams` |
22 +
23 +**Returns**
24 +
25 +`connected_account_refresh_response.ConnectedAccountRefres...` — The refresh response.
26 +
27 +**Example**
28 +
29 +```python
30 +composio.connected_accounts.refresh("ca_abc123")
31 +```
32 +
33 +---
34 +
35 +### revoke()
36 +
37 +Revoke a connected account's upstream tokens (best effort) and mark the connection `REVOKED`. Raises `composio.exceptions.ComposioConnectedAccountRevocationNotSupportedError` when the toolkit does not support programmatic revocation (API 400) and `composio.exceptions.ComposioConnectedAccountNotRevokableError` when the connection is not in a revokable state (API 409).
38 +
39 +```python
40 +def revoke(nanoid: str) -> connected_account_revoke_response.ConnectedAccountRevokeR...
41 +```
42 +
43 +**Parameters**
44 +
45 +| Name | Type |
46 +|------|------|
47 +| `nanoid` | `str` |
48 +
49 +**Returns**
50 +
51 +`connected_account_revoke_response.ConnectedAccountRevokeR...` — The revoked tokens and the updated connected account.
52 +
53 +**Example**
54 +
55 +```python
56 +result = composio.connected_accounts.revoke("ca_abc123")
57 +print(result.connected_account.status) # "REVOKED"
58 +```
59 +
60 +---
61 +
62 +### complete_auth()
63 +
64 +Complete a deferred OAuth connection once you have verified the user's identity. When your project has an OAuth callback verifier configured, Composio does not activate a new OAuth connection by itself: it redirects to your verifier with a single-use session URI. After confirming who the user is, redeem it here; Composio checks that your project owns the pending connection and that `user_id` is its owner, completes the token exchange, and the connection becomes `ACTIVE`. Redeeming a session twice, or after it expires, fails with a 404 from the API.
65 +
66 +```python
67 +def complete_auth(user_id: str, session_uri: str) -> connected_account_complete_auth_response.ConnectedAccount...
68 +```
69 +
70 +**Parameters**
71 +
72 +| Name | Type |
73 +|------|------|
74 +| `user_id` | `str` |
75 +| `session_uri` | `str` |
76 +
77 +**Returns**
78 +
79 +`connected_account_complete_auth_response.ConnectedAccount...` — The completed `connected_account_id` and its `toolkit_slug`.
80 +
81 +**Example**
82 +
83 +```python
84 +result = composio.connected_accounts.complete_auth(
85 + user_id="user_123",
86 + session_uri=session_uri, # from the verifier redirect
87 +)
88 +print(result.connected_account_id)
89 +```
90 +
91 +---
92 +
93 ### update()
94
95 Update a connected account's alias and/or credentials.
@@ -177,4 +262,4 @@ def wait_for_connection(id: str, timeout: float | None = ...) -> connected_accou
262
263 ---
264
180 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/connected_accounts.py#L340)
265 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/connected_accounts.py#L355)
docs/content/reference/sdk-reference/python/toolkits.mdx
+116 -1
@@ -48,6 +48,121 @@ def get(slug: str | None = ..., query: toolkit_list_params.ToolkitListParams | N
48
49 ---
50
51 +### get_many()
52 +
53 +Fetch several toolkits by slug in one request.
54 +
55 +```python
56 +def get_many(slugs: Sequence[str], category: str | None = ..., managed_by: Literal['composio', 'all', 'project' | None] = ..., sort_by: Literal['usage', 'alphabetically' | None] = ..., limit: float | None = ..., cursor: str | None = ...) -> List[Any]
57 +```
58 +
59 +**Parameters**
60 +
61 +| Name | Type |
62 +|------|------|
63 +| `slugs` | `Sequence[str]` |
64 +| `category?` | `str \| None` |
65 +| `managed_by?` | `Literal['composio', 'all', 'project' \| None]` |
66 +| `sort_by?` | `Literal['usage', 'alphabetically' \| None]` |
67 +| `limit?` | `float \| None` |
68 +| `cursor?` | `str \| None` |
69 +
70 +**Returns**
71 +
72 +`List[Any]` — The matching toolkits.
73 +
74 +**Example**
75 +
76 +```python
77 +toolkits = composio.toolkits.get_many(["github", "slack"])
78 +for toolkit in toolkits:
79 + print(toolkit.slug, toolkit.name)
80 +```
81 +
82 +---
83 +
84 +### changelog()
85 +
86 +Retrieve the toolkit changelog (the last 10 versions per toolkit).
87 +
88 +```python
89 +def changelog() -> toolkit_retrieve_changelog_response.ToolkitRetrieveChange...
90 +```
91 +
92 +**Returns**
93 +
94 +`toolkit_retrieve_changelog_response.ToolkitRetrieveChange...` — The changelog entries under `.items`.
95 +
96 +**Example**
97 +
98 +```python
99 +changelog = composio.toolkits.changelog()
100 +for entry in changelog.items:
101 + print(entry.slug, [v.version for v in entry.versions])
102 +```
103 +
104 +---
105 +
106 +### recommend_scopes()
107 +
108 +Recommend the OAuth scopes to request so a connection can run the given tools. Experimental — the API marks this endpoint beta.
109 +
110 +```python
111 +def recommend_scopes(toolkit_slug: str, params: toolkit_recommend_scopes_params.ToolkitRecommendScopesParams = ...) -> toolkit_recommend_scopes_response.ToolkitRecommendScopesR...
112 +```
113 +
114 +**Parameters**
115 +
116 +| Name | Type |
117 +|------|------|
118 +| `toolkit_slug` | `str` |
119 +| `params?` | `toolkit_recommend_scopes_params.ToolkitRecommendScopesParams` |
120 +
121 +**Returns**
122 +
123 +`toolkit_recommend_scopes_response.ToolkitRecommendScopesR...` — The `least_privilege` and `fewest` scope sets plus the `conditional` scopes, under `.scopes`.
124 +
125 +**Example**
126 +
127 +```python
128 +recommendation = composio.toolkits.recommend_scopes(
129 + "gmail",
130 + tools=["GMAIL_SEND_EMAIL", "GMAIL_FETCH_EMAILS"],
131 +)
132 +print(recommendation.scopes.least_privilege)
133 +```
134 +
135 +---
136 +
137 +### list_grant_contexts()
138 +
139 +List the grant-context dimensions a toolkit's scope recommendation depends on, with their allowed values and the default the API assumes. Experimental — the API marks this endpoint beta.
140 +
141 +```python
142 +def list_grant_contexts(toolkit_slug: str, params: toolkit_retrieve_scopes_grant_context_params.ToolkitRetrieveScopesGrantContextParams = ...) -> toolkit_retrieve_scopes_grant_context_response.ToolkitRet...
143 +```
144 +
145 +**Parameters**
146 +
147 +| Name | Type |
148 +|------|------|
149 +| `toolkit_slug` | `str` |
150 +| `params?` | `toolkit_retrieve_scopes_grant_context_params.ToolkitRetrieveScopesGrantContextParams` |
151 +
152 +**Returns**
153 +
154 +`toolkit_retrieve_scopes_grant_context_response.ToolkitRet...` — `grant_context_dimensions` and `default_grant_context`.
155 +
156 +**Example**
157 +
158 +```python
159 +contexts = composio.toolkits.list_grant_contexts("gmail")
160 +for dimension in contexts.grant_context_dimensions:
161 + print(dimension.dimension, dimension.values)
162 +```
163 +
164 +---
165 +
166 ### list_categories()
167
168 List all categories of toolkits.
@@ -119,4 +234,4 @@ def get_auth_config_creation_fields(toolkit: str, auth_scheme: AuthSchemeL, requ
234
235 ---
236
122 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/toolkits.py#L26)
237 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/toolkits.py#L33)
docs/content/reference/sdk-reference/python/triggers.mdx
+1 -1
@@ -247,4 +247,4 @@ async def webhook(request: Request):
247
248 ---
249
250 -[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/triggers.py#L1138)
250 +[View source](https://github.com/composiohq/composio/blob/next/python/composio/core/models/triggers.py#L1129)