Skip to main content

Methods

refresh()

Refresh the credentials of a connected account.
Parameters Returns connected_account_refresh_response.ConnectedAccountRefres... — The refresh response. Example

revoke()

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).
Parameters 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 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.
Parameters 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.
Parameters 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; raises ComposioAclOnlyForSharedError 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.
Parameters 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 the wait_for_connection method.
Parameters Returns ConnectionRequest — The connection request.
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.
Parameters Returns ConnectionRequest — Connection request object. Example

wait_for_connection()

Wait for connected account with given ID to be active
Parameters Returns connected_account_retrieve_response.ConnectedAccountRetri...
View source