Introduction to Entities

  • Each unique user is represented by a unique entity id.
  • If you have two users, Jessica and Melissa, they will have unique entity ids.

Introduction to Connected Accounts

  • When a user connects their account, a connected_account object is created.
  • This object securely stores authentication data such as access tokens and refresh tokens.

πŸ” Master Authentication in Minutes!

Authentication Made Simple

Unlock the full potential of Composio’s secure authentication system - Perfect for both beginners and advanced users.

Connecting an Account for your User

Connecting a user account requires a few API calls to authenticate and authorize access. The process involves:

  1. Fetch Required Parameters - Get the authentication requirements for the chosen application
  2. Collect User Input - Gather the required parameters from your user interface
  3. Create Connection - Initialize a new connection with the collected parameters
  4. Handle OAuth Flow - For OAuth applications, redirect the user to complete authorization
  5. Verify Status - Check that the connection was successful

The code snippets below demonstrate how to implement this flow in your application.

1

Collect Parameters Required to create a Connection

To create a connected account for your user:

  1. Fetch required auth parameters for the application
  2. Collect these parameters from the user
  3. Initiate a new connection request
Linear: Requires api_key

Collect the required parameters from your user through your preferred interface (UI, chat, or API).

All parameters should be provided as strings.

2

Try creating a connection with the parameters collected

In the code snippets below replace redirect_url

Some applications require user redirection to complete the authentication process. Gmail for example requires redirecting the user to Google’s login page.

3

Fetch the Connection Params (Status, Access Token, Refresh Token...)

If you want to use connection params locally and build custom actions -

Connection status can be failed, initiated or active.

Example of how connection params would look like

You can fetch connection details after user is redirected back to your app. (If redirect was needed)

connection_status & connectedAccountId will be available in the query params.

Get All Connected accounts

Here’s your modified documentation with three tabs (Python, JavaScript, and API), each containing relevant steps and code snippets:

Execute Agent and Perform Tasks on Behalf of an Entity

Examples of Authentication Flows

OAuth Authentication

Learn how to implement OAuth authentication in your application

API Key Authentication

Learn how to implement API Key authentication in your application