Composio provides two authentication flows for connecting users to third-party apps. In-chat authentication lets the agent handle OAuth prompts automatically — no extra setup required. Manual authentication lets your app initiate connections during onboarding or from a settings page, giving you full control over when and where users authenticate.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ComposioHQ/composio/llms.txt
Use this file to discover all available pages before exploring further.
In-chat authentication
By default, every session includes theCOMPOSIO_MANAGE_CONNECTIONS meta-tool. When a user asks the agent to do something that requires an account the agent hasn’t connected yet, the agent calls this meta-tool and returns a Connect Link URL directly in chat. The user clicks the link, completes OAuth, confirms in the conversation, and the agent retries the original task.
No extra setup is required. Just create a session:
- Tab Title
- Tab Title
callbackUrl:
- Tab Title
- Tab Title
Manual authentication with session.authorize()
Use manual authentication when you want users connected before they ever start chatting — for example, during onboarding, from a settings page, or as a pre-flight check before running an automated task.
Create a session and disable in-chat auth promptsPass
manageConnections: false to prevent the agent from prompting users to authenticate in chat. You’ll handle auth entirely in your UI.- Tab Title
- Tab Title
Generate a Connect Link with
session.authorize()Call session.authorize() with the toolkit slug to get a redirectUrl (also called redirect_url in Python). Redirect the user to this URL to start the OAuth flow.- Tab Title
- Tab Title
Wait for the user to complete OAuthPoll for completion using
waitForConnection() / wait_for_connection(). The method resolves with the connected account once the user finishes authentication.- Tab Title
- Tab Title
If the user closes the Connect Link without completing auth, the connection stays in
INITIATED status until it expires. waitForConnection() will timeout after the specified milliseconds.Callback URL
Pass acallbackUrl to control where users land after they finish authenticating. You can embed query parameters to carry context through the OAuth flow:
- Tab Title
- Tab Title
| Parameter | Description |
|---|---|
status | success or failed |
connected_account_id | The ID of the newly created connected account |
Checking connection status
Usesession.toolkits() to inspect which toolkits are connected for the current session user:
- Tab Title
- Tab Title
Putting it all together
A common pattern is to verify all required connections before starting the agent loop:- Tab Title
- Tab Title
Sessions
Understand how sessions work and what options are available
Connected Accounts
Manage multiple connected accounts per user and toolkit
MCP
Use the session MCP URL with Claude Desktop, Cursor, and other MCP clients
Tool Router
Semantically select tools at runtime to keep LLM context focused