evanth_ai_rep
07/31/2025, 4:37 PMevanth_ai_rep
07/31/2025, 4:38 PMError 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'
}evanth_ai_rep
07/31/2025, 4:47 PMComposio Support Agent
07/31/2025, 5:04 PMevanth_ai_rep
07/31/2025, 7:53 PMimport { 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 MCPevanth_ai_rep
07/31/2025, 7:55 PMComposio Support Agent
08/01/2025, 4:45 AMtypescript
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.evanth_ai_rep
08/06/2025, 9:17 AMevanth_ai_rep
08/06/2025, 9:18 AMComposio Support Agent
08/06/2025, 10:02 AM