Configuring integrations via the API
Connect first-party services, custom HTTP APIs, MCP servers, and Pipedream apps to an agent from the SDK — and fetch the agent's test code.
Channels and integrations are different surfaces, and only one of them is writable from the API.
Channels — WhatsApp, web chat, and telephony/voice — are still connected on the Deploy screen of the Console dashboard. The SDK can list them (agents.channels.list) but cannot create or remove a channel connection.
Integrations are now writable. agents.integrations exposes four connector families, each with list, configure, and disconnect, alongside the existing read-only agents.integrations.list that returns everything connected.
First-party connectors (bimpeai)
bimpeai.configure connects a BimpeAI first-party service by type — google_calendar, stripe, paystack, google_sheets, or bumpa — passing the keys that service needs. It returns an { onboarding_url } for any step that has to finish in the dashboard (OAuth, for example).
await bimpe.agents.integrations.bimpeai.configure(agentId, {
type: "stripe",
public_key: "pk_…",
secret_key: "sk_…",
currency: "NGN",
});
// Google Calendar returns an onboarding_url to complete OAuth in the dashboard.
const { onboarding_url } = await bimpe.agents.integrations.bimpeai.configure(agentId, {
type: "google_calendar",
});
await bimpe.agents.integrations.bimpeai.list(agentId);client.agents.integrations.bimpeai.configure(
agent_id, type="stripe", public_key="pk_…", secret_key="sk_…", currency="NGN"
)
# Google Calendar returns an onboarding_url to complete OAuth in the dashboard.
result = client.agents.integrations.bimpeai.configure(agent_id, type="google_calendar")
client.agents.integrations.bimpeai.list(agent_id)Custom HTTP APIs (customApi)
For a service that is not first-party, register it as a custom API and add tools the agent can call. configure returns the integration; tools.add registers one callable action against it.
const api = await bimpe.agents.integrations.customApi.configure(agentId, {
name: "Order system",
base_url: "https://api.example.com/v1",
auth_type: "bearer",
auth_config: { token: "…" },
});
await bimpe.agents.integrations.customApi.tools.add(agentId, api.id, {
name: "Create order",
http_method: "POST",
url_template: "/orders",
});
await bimpe.agents.integrations.customApi.tools.list(agentId, api.id);api = client.agents.integrations.custom_api.configure(
agent_id,
name="Order system",
base_url="https://api.example.com/v1",
auth_type="bearer",
auth_config={"token": "…"},
)
client.agents.integrations.custom_api.tools.add(
agent_id, api.id, {"name": "Create order", "http_method": "POST", "url_template": "/orders"}
)
client.agents.integrations.custom_api.tools.list(agent_id, api.id)In Python, configure takes the body as keyword arguments, while tools.add takes a single dict — its tool body carries a timeout field that would otherwise collide with the per-call request timeout.
MCP servers (mcpServer)
Connect a Model Context Protocol server, then discover its tools and test the connection.
const mcp = await bimpe.agents.integrations.mcpServer.configure(agentId, {
name: "MR Guild",
server_url: "https://mrguild.com/api/mcp",
transport: "streamable_http",
});
await bimpe.agents.integrations.mcpServer.discover(agentId, mcp.id);
await bimpe.agents.integrations.mcpServer.test(agentId, mcp.id);
await bimpe.agents.integrations.mcpServer.tools.list(agentId, mcp.id);mcp = client.agents.integrations.mcp_server.configure(
agent_id, name="MR Guild", server_url="https://mrguild.com/api/mcp", transport="streamable_http"
)
client.agents.integrations.mcp_server.discover(agent_id, mcp.id)
client.agents.integrations.mcp_server.test(agent_id, mcp.id)
client.agents.integrations.mcp_server.tools.list(agent_id, mcp.id)Pipedream (pipedream)
pipedream.configure starts OAuth onboarding for a Pipedream app and returns the { onboarding_url } the user completes in the dashboard.
const { onboarding_url } = await bimpe.agents.integrations.pipedream.configure(agentId, {
app_slug: "google-sheets",
});result = client.agents.integrations.pipedream.configure(agent_id, app_slug="google-sheets")Fetching the test code
The test code lets you exercise an agent before it goes live, without pointing real customer traffic at it. agents.getTestCode returns the agent's code and a channels object with the per-channel details a tester needs. The code is created on first request if the agent does not have one yet.
const { code, channels } = await bimpe.agents.getTestCode(agentId);
// Each messaging channel carries a ready-to-send start message, the
// destination, and a deep link. Telephony only reports whether it is on.
console.log(channels.whatsapp.start_message); // e.g. "start WVVTC37U"
console.log(channels.whatsapp.phone_number, channels.whatsapp.url);
console.log(channels.telephony.is_enabled);test_code = client.agents.get_test_code(agent_id)
# Each messaging channel carries a ready-to-send start message, the
# destination, and a deep link. Telephony only reports whether it is on.
print(test_code.channels.whatsapp.start_message) # e.g. "start WVVTC37U"
print(test_code.channels.whatsapp.phone_number, test_code.channels.whatsapp.url)
print(test_code.channels.telephony.is_enabled)channels covers whatsapp, instagram, messenger, and telephony. Each messaging channel exposes is_enabled, a start_message (the exact start <code> text), a destination (phone_number, username, or page), and a url deep link — a tester opens the url, or sends the start_message to the destination, and starts chatting with the agent. WhatsApp opens a 24-hour reply window once that message lands. telephony exposes only is_enabled; you test voice by placing a call with calls.make(agentId, { destination, is_test_call: true }).
From the dashboard, the same panel lives on the Deploy screen: it shows the test code with Test on WhatsApp and Test on Instagram buttons, a start <code> message to share with testers, and a call option for voice.
To inject a test message programmatically rather than using a human tester — and for the pause-AI rule when a human takes over a conversation — see Test your agent in the anatomy guide.