```diff
--- test_files/529-original.txt	2025-03-07 19:07:06
+++ test_files/529-modified.txt	2025-03-07 19:07:06
@@ -1,211 +1,285 @@
 ---
-title: "Connected Accounts"
+title: "Create & Manage Connections for Users"
 sidebarTitle: "Connections"
-icon: "link"
-description: "Guide to creating connections for multiple users"
+description: "Learn how to securely manage and authenticate multiple user connections"
 ---
 
-### Introduction to <u>Connected Accounts</u>
-- When a user connects their account, a `connected_account` object is created. 
-- **Connected Account** securely stores **authentication data** such as **api keys, access tokens and refresh tokens**.
+### Entities
 
-### Introduction to <u>Entities</u>
+- Each **user** is represented by a **unique entity ID**.
+- If you have two users, **default** and **Melissa**, they will each have **unique entity IDs**.
+- You can use an entity object to manage connected accounts and perform actions on behalf of a user, learn more [here](/patterns/tools/use-tools/action-guide-without-agents#how-can-i-use-tools-for-a-specific-user). Here's how to retrieve an entity object:
 
-- **Each unique user/tenant** is represented by a **unique entity id**.
-- If you have **two users, Jessica and Melissa**, they will each have **unique entity ids**.
-
-### Connecting an Account for your User
-<Steps>
-<Step title="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
-
-<Note> Linear: Requires `api_key`, Shopify: Requires `shop_name` for OAuth flow </Note>
-
 <CodeGroup>
-```python Python - Fetch Auth Parameters
-from composio import ComposioToolSet, App
+```python Python
+from composio import ComposioToolSet
+
 toolset = ComposioToolSet()
+entity = toolset.get_entity(id='default')
+```
 
-response = toolset.get_expected_params_for_user(app=App.LINEAR) # can use integration_id instead of app
+```javascript JavaScript
+import { ComposioToolSet } from "composio-core";
 
-print(response["expected_params"])
+const toolset = new ComposioToolSet();
+const entity = toolset.client.getEntity(id='default');
 ```
+</CodeGroup>
+<Info>If entity ID is not specified, `default` will be used as the entity ID.</Info>
 
-```javascript Javascript - Fetch Auth Parameters
-import { Composio, OpenAIToolSet } from "composio-core";
+### Connected Accounts
+- When a user connects their account, a `connected_account` object is created. 
+- **Connected Account** securely stores **authentication data** such as **API keys, access tokens and refresh tokens**.
 
-const toolset = new OpenAIToolSet();
+### Integrations & Connections
 
-const expectedInputFields = await toolset.getExpectedParamsForUser({
-    app: "gmail",
-});
+**Integration**
+- An integration is your app's configuration for services like Gmail or GitHub
+- Each integration contains authentication method, API scopes, client credentials and other app settings
+- Developers can create multiple integrations with different configurations, learn more [here](../Auth/Integrations#what-is-an-integration)
 
-console.log(expectedInputFields)
+**Connection**
+- A connection links a user to an integration
+- Multiple connections can be created for the same integration
+- Learn how to use connections [here](../Auth/using-connections)
+
+### Initiating a new connection for your user
+<Tabs>
+<Tab title="OAuth-Based Apps">
+<Steps>
+<Step title="Install libraries">
+<CodeGroup>
+```bash Python
+pip install composio-core
 ```
+```bash JavaScript
+npm install composio-core
+```
 </CodeGroup>
-
-Collect the required parameters from your user through your preferred interface (UI, chat, or API).
-
-<Note>
-All parameters should be provided as strings.
-</Note>
-
 </Step>
+<Step title="Import Libraries & Initialize Toolset">
+<CodeGroup>
+``` python Python
+from composio import ComposioToolSet, App 
+toolset = ComposioToolSet()
+```
+``` javascript JavaScript
+import { ComposioToolSet } from "composio-core";
+const toolset = new ComposioToolSet();
+```
+</CodeGroup>
+</Step>
+<Step title="Initiate a new connection">
+Below are the accepted parameters for initiating a new connection:
+- `integration_id`: ID of the existing integration, use this to create a connection for an existing integration, If no integration exists for the given app, new one is automatically created
+- `app`: name of the app to create a connection for
+- `labels`: labels to be assigned to the connection, which can later be used to filter connections
+- `entity_id`: ID of the user for whom the connection is being created
+- `redirect_url`: URL to redirect the user to after the connection is created (for OAuth auth scheme). If not provided, the user will be redirected to Composio's connection success/failer page
+- `connected_account_params`/`data`: If auth mode is non-OAuth, this is where parameters need to be passed for creating a connection (API key, shopify store name, etc)
+- `auth_scheme`: Type of authentication to be used for the connection (OAUTH2 or API_KEY, BASIC_WITH_JWT, etc), OAUTH2 will be defaulted if not provided
+- `auth_config`: If auth mode is OAuth, this is where the configuration needs to be provided for creating a connection (client_id, client_secret, etc)
 
-<Step title="Try creating a connection with the parameters collected">
-
-In the code snippets below replace `user_id` and `redirect_url`
-
+Let's create a connection for the user **default** for the Gmail app.
 <CodeGroup>
-```python Python - New Connection
+```python Python
+# Store connection parameters
+redirect_url = "https://yourwebsite.com/connection/success"
+entity_id = "default" 
 
-# This is the URL that the user will be redirected to after completing the authentication process
-redirect_url = "https://yourwebsite.com/connection/callback"
-
-entity_id = "user_id" # This is the unique identifier for the user
-
-# Collect the parameters from the user
-# Here we are assuming that the user has provided the parameters
-# In a real-world scenario, you would collect these parameters from the user via your app's UI.
-collected_params = {
-    # "api_key": "1234567890" # This is an example, actual values will be different
-}
-
-# Initiate the connection
-connection_request = toolset.initiate_connection(connected_account_params=collected_params,entity_id=entity_id,app=App.LINEAR,redirect_url=redirect_url)
-
-# If the connection method is OAuth, redirect the user to the URL below
-print(connection_request.redirectUrl)
-
-# Check the status of the connection
-print(connection_request.status)
+connection_request = toolset.initiate_connection(redirect_url=redirect_url, entity_id=entity_id, app=App.GMAIL)
 ```
+```javascript JavaScript
+// Store connection parameters
+const redirectURL = "https://yourwebsite.com/connection/success"
+const entityId = "default" 
 
-```javascript Javascript - New Connection
-const redirectUrl = "https://yourwebsite.com/connection/callback"
-
-const entityId = "user_id" # This is the unique identifier for the user
-
-// Collect the parameters from the user
-// Here we are assuming that the user has provided the parameters
-// In a real-world scenario, you would collect these parameters from the user via your app's UI.
-const collectedParams = {
-    // "api_key": "1234567890" // This is an example, actual values will be different
-}
-
-const connectionRequest = await toolset.client.connectedAccounts.initiate({
-    data: {
-        ...collectedParams
-    },
-    userUuid: entityId,
-    integrationId: expectedInputFields.integrationId, 
-    redirectUri: redirectUrl
+const connectionRequest = await toolset.connectedAccounts.initiate({
+  appName: "gmail",
+  redirectUri: redirectURL,
+  entityId: entityId,
+  authMode: "OAUTH2",
 });
-
-console.log("Click on this link to connect your account", connectionRequest.redirectUrl)
-
-const connectedAccount = await connectionRequest.waitUntilActive(30); // Wait for the connection to be active
-
-console.log("Connected account is active", connectedAccount)
+console.log(connectionRequest);
 ```
 </CodeGroup>
-
-<Note>
-Some applications require user redirection to complete the authentication process.
-Gmail for example requires redirecting the user to Google's login page.
-</Note>
-
+Connection request output: 
+<CodeGroup>
+```bash Python
+connectionStatus='INITIATED'
+connectedAccountId='<connected_account_id>'
+redirectUrl='https://accounts.google.com...'
+```
+```bash JavaScript
+connectionStatus='INITIATED'
+connectedAccountId='<connected_account_id>'
+redirectUrl='https://accounts.google.com...'
+```
+</CodeGroup>
+- `connectionStatus`: status of the connection, initially it will be **INITIATED** and will change to **ACTIVE** or **FAILED** after user completes the auth flow
+- `connectedAccountId`: ID of the newly created account, you can use this ID to retrieve the connection object
+- `redirectUrl`: URL to redirect to perform authentication, post the authentication flow user will be redirect to the page specified in the `redirectUrl` parameter
 </Step>
+<Step title="Checking the status of the connection">
+Use the connectedAccountId to get the detailed information about the connection, learn more [here](../Auth/using-connections).
+<CodeGroup>
+```python Python
+connection = toolset.get_connected_account(id="83f5e791-e6c4-4cd6-8e3a-dada66b0a8f1")
+print(connection.status)
+```
+```javascript JavaScript
+const connection = await toolset.connectedAccounts.get({
+    connectedAccountId: "<connected_account_id>"
+});
+console.log(connection.status);
+```
+</CodeGroup>
+Status of the connection can be one of the following:
+- `INITIATED`: Connection is initiated but not yet completed
+- `ACTIVE`: Connection is active and ready to use
+- `FAILED`: Connection failed to be created
+</Step>
+</Steps>
+<Tip>Each App integration has a unique **integration ID**. You can use this ID instead of the **app name** when creating connections.</Tip>
+</Tab>
+<Tab title="Non OAuth-Based Apps">
+<Steps>
+<Step title="Install libraries">
+<CodeGroup>
+```bash Python
+pip install composio-core
+```
+```bash JavaScript
+npm install composio-core
+```
+</CodeGroup>
+</Step>
+<Step title="Import Libraries & Initialize Toolset">
+<CodeGroup>
+``` python Python
+from composio import ComposioToolSet, App 
+toolset = ComposioToolSet()
+```
+``` javascript JavaScript
+import { ComposioToolSet } from "composio-core";
+const toolset = new ComposioToolSet();
+```
+</CodeGroup>
+</Step>
+<Step title="Collect parameters required to create a connection">
+Get the expected parameters required to create a connection & pass them while initiating a new connection (API Key, Subdomain URL, Username etc.).
+<CodeGroup>
+```python Python
+# You can use integration_id instead of app
+response = toolset.get_expected_params_for_user(app=App.FIRECRAWL) 
+print(response["expected_params"])
+```
+```javascript JavaScript
+const expectedInputFields = await toolset.integrations.getRequiredParams(
+    "<app-integration-id>", //integrationId
+);
+console.log(expectedInputFields);
+```
+</CodeGroup>
+Response:
+```bash {3}
+[
+  ExpectedFieldInput(
+  name='api_key',
+  type='string',
+  description='Your FireCrawl API key for authentication. Obtain it from your FireCrawl settings.',
+  displayName='API Key',
+  is_secret=False,
+  required=True,
+  expected_from_customer=True,
+  default=None,
+  get_current_user_endpoint=None)
+]
+```
+To create a new connection for FireCrawl app, we need the FireCrawl API key
+</Step>
+<Step title="Initiate a new connection">
+Below are the accepted parameters for initiating a new connection:
+- `integration_id`: ID of the existing integration, use this to create a connection for an existing integration, If no integration exists for the given app, new one is automatically created
+- `app`: name of the app to create a connection for
+- `labels`: labels to be assigned to the connection, which can later be used to filter connections
+- `entity_id`: ID of the user for whom the connection is being created
+- `redirect_url`: URL to redirect the user to after the connection is created (for OAuth auth scheme). If not provided, the user will be redirected to Composio's connection success/failer page
+- `connected_account_params`/`data`: If auth mode is non-OAuth, this is where parameters need to be passed for creating a connection (API key, shopify store name, etc)
+- `auth_scheme`: Type of authentication to be used for the connection (OAUTH2 or API_KEY, etc), OAUTH2 will be defaulted if not provided
+- `auth_config`: If auth mode is OAuth, this is where the configuration needs to be provided for creating a connection (client_id, client_secret, etc)
 
-<Step title="Fetch the Connection Params (Status, Access Token, Refresh Token...)">
-
-If you want to use connection params locally and build custom actions - 
-
-<Info>
-Connection status can be `failed`, `initiated` or `active`.
-</Info>
+Let's create a connection for the user **default** for the FireCrawl app.
 <CodeGroup>
-```python Python - Fetch the connection status & details (Optional)
-connected_account = toolset.get_connected_account(connection_request.connectedAccountId)
+```python Python
+# Store connection parameters
+entity_id = "default"
+collected_params = {"api_key": "<firecrawl_api_key>"}
+auth_scheme = "API_KEY"
 
-# Get the parameters for your local usage
-print(toolset.get_auth_params(connection_id=connected_account.id))
-
-#print(connected_account.connectionParams) # use this for raw/advanced cases
+# Initiate new connection (You can use integration_id instead of app)
+connection_request = toolset.initiate_connection(
+    connected_account_params=collected_params,
+    entity_id=entity_id,
+    app=App.FIRECRAWL,
+    auth_scheme=auth_scheme,
+)
 ```
+```javascript JavaScript
+// Store connection parameters
+const entityId = "default";
+const collectedParams = {
+    api_key: "<firecrawl_api_key>"
+};
+const authScheme = "API_KEY";
 
-```javascript Javascript - Fetch the connection params (Optional)
-const connectedAccount = await toolset.client.connectedAccounts.get({
-    connectedAccountId: connectionRequest.connectedAccountId
+const connection_request = await toolset.connectedAccounts.initiate({
+    data: collectedParams,
+    entityId: entityId,
+    appName: "firecrawl",
+    authMode: authScheme,
+    authConfig: {}
 })
-
-const connectedAccountAuthParams = await toolset.getAuthParams({
-    connectedAccountId: connectedAccount.connectedAccountId
-})
-
-console.log("Connected account auth params", connectedAccountAuthParams)
-
-//console.log("Connected account raw auth params", connectedAccount.connectionParams)
-
+console.log(connection_request)
 ```
 </CodeGroup>
-
-Example of how connection params would look like 
-
+Connection request output:
 <CodeGroup>
-``` JSON Auth Params Output
-{
-	"base_url": "", // This is the base URL for the API Ex. https://api.linear.app
-	"params": [{ // This is the list of all the params
-		"name": "x-api-key", 
-		"in": "header", // `in` value could be of type `header`, `query` 
-		"value": "<api-key>"
-	}],
-	"body": {}
-}
+```bash Python
+connectionStatus='ACTIVE' 
+connectedAccountId='<connected_account_id>' 
+redirectUrl=None
 ```
-``` Javascript Raw Auth Params Output
-Connected account raw auth params {
-  scope: '********',
-  scopes: '********',
-  id_token: '********',
-  client_id: '********',
-  expires_in: '********',
-  token_type: '********',
-  redirectUrl: 'https://accounts.google.com/o/oauth2/v2/auth?client_id=96-8p515bt7ijf94c2bf4a5lev5jr6r7oc1.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fbackend.composio.dev%2Fapi%2Fv1%2Fauth-apps%2Fadd&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fgmail.modify&response_type=code&access_type=offline&prompt=consent&state=staging_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.30.W9PV-ncrbbPhnjfcgBCN8ZNn9A8V2lzCbXQR2fOXht4&code_challenge=YpyY74p3BJU_-a_mIq4GZyka2FlpnH4APVIfQ&code_challenge_method=S256',
-  callback_url: '********',
-  client_secret: '********',
-  code_verifier: '********',
-  refresh_token: '********',
-  headers: {
-    Authorization: 'Bearer ya29.-BhZtwh0ZLk-',
-  },
-  queryParams: {},
-  base_url: 'https://www.googleapis.com'
-}
+```bash JavaScript
+connectionStatus='ACTIVE' 
+connectedAccountId='<connected_account_id>' 
+redirectUrl=None
 ```
-
 </CodeGroup>
-
-
-
-<Note>
-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.
-</Note>
+- `connectionStatus`: status of the connection
+- `connectedAccountId`: ID of the newly created account, you can use this ID to retrieve the connection object
+- `redirectUrl`: URL to redirect to perform authentication, since its not an OAuth type auth scheme, redirectUrl will be None
 </Step>
+<Step title="Checking the status of the connection">
+Use the connectedAccountId to get the detailed information about the connection, learn more [here](../Auth/using-connections).
+<CodeGroup>
+```python Python
+connection = toolset.get_connected_account(id="<connected_account_id>")
+print(connection.status)
+```
+```javascript JavaScript
+const connection = await toolset.connectedAccounts.get({
+    connectedAccountId: "<connected_account_id>"
+});
+console.log(connection.status);
+```
+</CodeGroup>
+Status of the connection can be one of the following:
+- `INITIATED`: Connection is initiated but not yet completed
+- `ACTIVE`: Connection is active and ready to use
+- `FAILED`: Connection failed to be created
+</Step>
 </Steps>
-
-### Receiving Webhooks alerts on new Connections
-
-Composio provides real-time webhook notifications for new connections. To utilize this feature:
-
-1. Set up webhook alerts in the Composio dashboard
-2. Configure your application to receive and parse the webhook payloads
-
-This allows you to instantly track when users integrate new services with your application.
+<Tip>Each App integration has a unique **integration ID**. You can use this ID instead of the **app name** when creating connections.</Tip>
+</Tab>
+</Tabs>
\ No newline at end of file
```
