https://linen.dev logo
Pipedrive Integration Oauth not imitating/working
# 🖥│support-forum
e
Using TS SDK with Composio Integration ID v2 to make connection. However it returns an error.
Error details:
Copy code
Error initiating connection: Error [ComposioError]: :no_entry_sign: Bad Request. The request was malformed or incorrect  on https://backend.composio.dev/api/v2/connectedAccounts/initiateConnection

    at CEG.throwAPIError (.next/server/chunks/51558.js:44395:15)

    at CEG.handleAllError (.next/server/chunks/51558.js:44363:35)

    at ConnectedAccounts.initiate (.next/server/chunks/51558.js:46021:23)

    at async handleInitiateConnection (.next/server/app/(backend)/api/composio-auth/route.js:320:33)

    at async responseGenerator (.next/server/app/(backend)/api/composio-auth/route.js:667:38)

    at async handleResponse (.next/server/app/(backend)/api/composio-auth/route.js:729:32) {

  metadata: [Object],

  errCode: 'BACKEND::BAD_REQUEST',

  description: 'Validation Errors: undefined',

  possibleFix: 'Please check the request parameters and ensure they are correct.',

  timestamp: '2025-07-31T16:25:41.824Z',

  errorId: '69110ea9-2d99-4f02-a066-f34efd2db1a8'

}
@udaysidagana
c
Hey, Could you share reproducible code snippet? Also, please specify your SDK version and Imports. Thanks!
e
Sure,
Copy code
import { getComposioToolset } from '@/libs/composio';

        const composioToolset = getComposioToolset();
        const entity = await composioToolset.getEntity(userId);

        const connectionReq = await entity.initiateConnection({
          config: {
            redirectUrl: redirectUri,
          },
          integrationId: specificIntegrationId,
        });
And based on the connectionID and userID, using mcp server http url to connect the user via MCP
Composio version: "composio-core": "^0.5.39",
c
Hi, based on your SDK version you can try this snippet and lmk if it works for you.
Copy code
typescript
import { ComposioToolSet } from "composio-core"; 

const composioToolset = new ComposioToolSet({
    apiKey: "<API_KEY>",
});

const entity = await composioToolset.getEntity("default");

const connectionReq = await entity.initiateConnection({
  config: {
    redirectUrl: "<REDIRECT_URL>", //redirect-to-post-auth
  },
  integrationId: "<uuid>", 
});

console.log(connectionReq);
Also, we recommend you to migrate to v3. Let me know if you need help with migration.
Also, regarding appending your connected account ID to your MCP server Url to specify a user, make sure you've converted the connected account from the payload which is in uuid to nanoID. You can use this endpoint:
e
Hey, this is the exact setup for me to imitate connections as well. But this isn't working with Piperdrive and Heygen, there were some others as well. That being said, almost every other app integrations works perfectly with this, it's only the Piperdrive and Heygen that I have noticed to be not working and throwing that error Would love any other suggestions or fixes to try, as Pipedrive is a little important for our integration suite.
@udaysidagana
c
Heygen is a API Key based App, you can use this documentation on initiating the connection: For Pipedream, if using OAuth method, you'll need to pass domain while initiating a connection. Let me know if you face any Issues while trying to initiate a connection. [https://v1.docs.composio.dev/tools/heygen](https://v1.docs.composio.dev/tools/heygen#api_key) [https://v1.docs.composio.dev/tools/pipedrive](https://v1.docs.composio.dev/tools/pipedrive#bearer_token)