@devries-cameron20 / composio-1 / commits / 786f40ade
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.

docs: add auth scheme tabs for updating credentials section

Dhawal Upadhyay committed Apr 9, 2026 at 22:04 UTC 786f40ade6a3a7287c4c79694830edf3c02001d5
1 file changed +80 -11
docs/content/docs/importing-existing-connections.mdx
+80 -11
@@ -170,8 +170,10 @@ console.log('Connected:', connection.id);
170
171 ## Updating credentials
172
173 -When credentials expire or rotate, update them in place without recreating the connection:
173 +When credentials expire or rotate, update them in place without recreating the connection. Fields you omit are preserved. Fields set to `null` are removed.
174
175 +<Tabs groupId="auth-scheme" items={['Bearer token', 'API key', 'Basic auth']} persist>
176 +<Tab value="Bearer token">
177 <Tabs groupId="language" items={['Python', 'TypeScript', 'curl']} persist>
178 <Tab value="Python">
179 ```python
@@ -203,19 +205,86 @@ await composio.connectedAccounts.update('ca_your_connection_id', {
205 curl -X PATCH https://backend.composio.dev/api/v3/connected_accounts/ca_xxx \
206 -H 'x-api-key: YOUR_API_KEY' \
207 -H 'Content-Type: application/json' \
206 - -d '{
207 - "connection": {
208 - "state": {
209 - "authScheme": "BEARER_TOKEN",
210 - "val": {"token": "new-access-token"}
211 - }
212 - }
213 - }'
208 + -d '{"connection":{"state":{"authScheme":"BEARER_TOKEN","val":{"token":"new-access-token"}}}}'
209 ```
210 </Tab>
211 </Tabs>
217 -
218 -Fields you omit are preserved. Fields set to `null` are removed.
212 +</Tab>
213 +<Tab value="API key">
214 +<Tabs groupId="language" items={['Python', 'TypeScript', 'curl']} persist>
215 +<Tab value="Python">
216 +```python
217 +composio.connected_accounts.update(
218 + "ca_your_connection_id",
219 + connection={
220 + "state": {
221 + "authScheme": "API_KEY",
222 + "val": {"generic_api_key": "new-api-key"},
223 + },
224 + },
225 +)
226 +```
227 +</Tab>
228 +<Tab value="TypeScript">
229 +```typescript
230 +await composio.connectedAccounts.update('ca_your_connection_id', {
231 + connection: {
232 + state: {
233 + authScheme: 'API_KEY',
234 + val: { generic_api_key: 'new-api-key' },
235 + },
236 + },
237 +});
238 +```
239 +</Tab>
240 +<Tab value="curl">
241 +```bash
242 +curl -X PATCH https://backend.composio.dev/api/v3/connected_accounts/ca_xxx \
243 + -H 'x-api-key: YOUR_API_KEY' \
244 + -H 'Content-Type: application/json' \
245 + -d '{"connection":{"state":{"authScheme":"API_KEY","val":{"generic_api_key":"new-api-key"}}}}'
246 +```
247 +</Tab>
248 +</Tabs>
249 +</Tab>
250 +<Tab value="Basic auth">
251 +<Tabs groupId="language" items={['Python', 'TypeScript', 'curl']} persist>
252 +<Tab value="Python">
253 +```python
254 +composio.connected_accounts.update(
255 + "ca_your_connection_id",
256 + connection={
257 + "state": {
258 + "authScheme": "BASIC",
259 + "val": {"username": "user@example.com", "password": "new-password"},
260 + },
261 + },
262 +)
263 +```
264 +</Tab>
265 +<Tab value="TypeScript">
266 +```typescript
267 +await composio.connectedAccounts.update('ca_your_connection_id', {
268 + connection: {
269 + state: {
270 + authScheme: 'BASIC',
271 + val: { username: 'user@example.com', password: 'new-password' },
272 + },
273 + },
274 +});
275 +```
276 +</Tab>
277 +<Tab value="curl">
278 +```bash
279 +curl -X PATCH https://backend.composio.dev/api/v3/connected_accounts/ca_xxx \
280 + -H 'x-api-key: YOUR_API_KEY' \
281 + -H 'Content-Type: application/json' \
282 + -d '{"connection":{"state":{"authScheme":"BASIC","val":{"username":"user@example.com","password":"new-password"}}}}'
283 +```
284 +</Tab>
285 +</Tabs>
286 +</Tab>
287 +</Tabs>
288
289 ## Using with Tool Router
290