Getting started
Quickstart
Install
npm i @bimpeai/sdkpip install bimpeaiEnd-to-end example
The example below walks through the full lifecycle: construct the client, pick a workflow, create an agent, and inspect any conversations that have already arrived.
Conversations are inbound
Customers start conversations by messaging your agent on a connected channel (WhatsApp, web chat, Instagram, or Messenger). The API lets you list and reply to those conversations — you cannot open a new conversation on the customer's behalf.
import { BimpeAI } from "@bimpeai/sdk";
const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });
// 1. Pick a workflow to bind the agent to.
const workflowPage = await bimpe.workflows.list();
const workflowId = workflowPage.data[0]?.id;
if (!workflowId) throw new Error("No workflows found — create one in the Console first.");
// 2. Create an agent bound to that workflow.
const agent = await bimpe.agents.create({
name: "Support bot",
agent_workflow_id: workflowId,
});
console.log("Created agent:", agent.id);
// 3. List conversations for the agent (customers initiate these via connected channels).
const conversationPage = await bimpe.conversations.list(agent.id);
const conversation = conversationPage.data[0];
if (conversation) {
// 4. Send a reply in an existing conversation.
const message = await bimpe.conversations.messages.send(agent.id, conversation.id, {
message: "Thanks for reaching out! How can I help you today?",
});
console.log("Sent message:", message.id);
} else {
console.log("No conversations yet — connect a channel in the Console and wait for a customer to message.");
}import os
from bimpeai import BimpeAI
client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])
# 1. Pick a workflow to bind the agent to.
workflows = list(client.workflows.list())
if not workflows:
raise RuntimeError("No workflows found — create one in the Console first.")
workflow_id = workflows[0].id
# 2. Create an agent bound to that workflow.
agent = client.agents.create(name="Support bot", agent_workflow_id=workflow_id)
print("Created agent:", agent.id)
# 3. List conversations for the agent (customers initiate these via connected channels).
conversations = list(client.conversations.list(agent.id))
if conversations:
conversation_id = conversations[0].id
# 4. Send a reply in an existing conversation.
message = client.conversations.messages.send(
agent.id, conversation_id, message="Thanks for reaching out! How can I help you today?"
)
print("Sent message:", message.id)
else:
print("No conversations yet — connect a channel in the Console and wait for a customer to message.")Next steps
- Connect a channel to your agent from the Console dashboard so customers can reach it.
- See the Guides for more advanced patterns such as streaming responses and handling rate limits.
- Browse the full API Reference for every available endpoint.