Methods
refresh()
Refresh the credentials of a connected account.
Returns
connected_account_refresh_response.ConnectedAccountRefres... — The refresh response.
Example
revoke()
Revoke a connected account’s upstream tokens (best effort) and mark the connectionREVOKED. 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).
Returns
connected_account_revoke_response.ConnectedAccountRevokeR... — The revoked tokens and the updated connected account.
Example
complete_auth()
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 thatuser_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.
Returns
connected_account_complete_auth_response.ConnectedAccount... — The completed connected_account_id and its toolkit_slug.
Example
update()
Update a connected account’s alias and/or credentials.
Returns
connected_account_patch_response.ConnectedAccountPatchRes... — Response with id, status, and success.
Example
update_acl()
Update the per-user ACL on a SHARED connected account. Experimental — shape may change in future releases. Only valid on SHARED connections; raisesComposioAclOnlyForSharedError on a PRIVATE connection. Omit a parameter to leave it unchanged; pass an empty list to clear an allow/deny list. At least one parameter must be provided.
Returns
connected_account_patch_response.ConnectedAccountPatchRes... — Response with id, status, and success.
Example
initiate()
Compound function to create a new connected account. This function creates a new connected account and returns a connection request. Users can then wait for the connection to be established using thewait_for_connection method.
Returns
ConnectionRequest — The connection request.
link()
Create a Composio Connect Link for a user to connect their account to a given auth config. This method will return an external link which you can use for the user to connect their account.
Returns
ConnectionRequest — Connection request object.
Example
wait_for_connection()
Wait for connected account with given ID to be active
Returns
connected_account_retrieve_response.ConnectedAccountRetri...
View source