Auth Lifecycle
Learn how to manage the lifecycle of an integration and connection
Integrations
Integrations are configuration objects that store credentials and settings for specific APIs. They store the following properties, among others:
Integration Properties
An Integration stores all necessary authentication and API communication details required for making authenticated requests to third-party services. These properties define how Composio interacts with the external API.
Configuring an integration
Typically you only need to create an integration once. That integration can be used by multiple users (called entities in Composio).
Each entity connects to an integration using a connection.
CLI
Dashboard
Code
Add an integration through the CLI and follow the steps outlined in the CLI. Make sure you have logged in.
On successful creation, you’ll receive an Integration ID - a unique identifier used for managing your integration.
Connections
A connection in Composio is an object that stores and manages your users’ authentication state and details for a specific app (integration).
An integration can have multiple connections, each representing a different user’s authentication state.
Creating a connection
Assuming the integration has been created and the ID is known, you can initiate a connection with the following code:
You can view the parameters for creating a connection here
Checking the status of a connection
Checking for status of a connection is useful to keep track of the authentication flow. This is especially useful for OAuth based flows.
The valid connection states are:
ACTIVE
INACTIVE
DELETED
INITIATED
EXPIRED
Getting connection details
You can get the details of a connection to inspect the connection parameters.
Connection Response Model
Deleting a connection
Deleting a connection is useful to remove a connection from the system. Typically done when a user wants to disconnect from an app or no longer wishes to give access to an app.