SDKs & Code Examples
Official SDKs with TypeScript types, auto-retry, pagination helpers, and webhook verification. Available for Node.js and Python.
Automatic retries on 429 and 5xx with exponential backoff
Iterate through all pages with a single loop — no manual offset management
Built-in HMAC-SHA256 signature verification with timing-safe comparison
TypeScript types (Node.js) and type hints (Python) for every request and response
Catch RateLimitError, NotFoundError, AuthenticationError — not raw HTTP codes
Node.js: zero dependencies (native fetch). Python: only requests.
Node.js / TypeScript
Installation
npm install @conferbot/nodeRequirements
Node.js 18 or later (uses native fetch). Zero runtime dependencies.
Quick start
import Conferbot from "@conferbot/node";
const conferbot = new Conferbot(process.env.CONFERBOT_API_KEY!);
// List chatbots
const chatbots = await conferbot.chatbots.list();
console.log(`Found ${chatbots.length} chatbots`);
// Get analytics for the first chatbot
const stats = await conferbot.analytics.get(chatbots[0].id, { days: 7 });
console.log(`${stats.recentResponses} responses in the last 7 days`);
// Create a chatbot
const newBot = await conferbot.chatbots.create({
name: "Support Bot",
description: "Handles customer inquiries",
});
console.log(`Created: ${newBot.id}`);Auto-pagination
// Iterate through ALL responses — pages are fetched automatically
for await (const response of conferbot.responses.listAll("chatbot_id")) {
console.log(response._id, response.chatDate);
}
// With date filters
for await (const response of conferbot.responses.listAll("chatbot_id", {
startDate: "2025-01-01",
endDate: "2025-01-31",
})) {
// process each response...
}Webhook verification
import express from "express";
import { constructWebhookEvent } from "@conferbot/node";
const app = express();
app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
try {
const event = constructWebhookEvent(
req.body,
req.headers["x-webhook-signature"] as string,
process.env.WEBHOOK_SECRET!
);
console.log("Event:", event.event, event.data);
res.sendStatus(200);
} catch {
res.status(401).send("Invalid signature");
}
});Error handling
import Conferbot, { NotFoundError, RateLimitError } from "@conferbot/node";
const conferbot = new Conferbot(process.env.CONFERBOT_API_KEY!);
try {
const bot = await conferbot.chatbots.get("nonexistent_id");
} catch (err) {
if (err instanceof NotFoundError) {
console.log("Chatbot not found");
} else if (err instanceof RateLimitError) {
console.log("Rate limit exceeded — SDK already retried 3 times");
} else {
throw err; // re-throw unexpected errors
}
}All methods
// ── Chatbots ──
conferbot.chatbots.list()
conferbot.chatbots.get(id)
conferbot.chatbots.create({ name, description? })
conferbot.chatbots.update(id, { name?, description?, disabled? })
conferbot.chatbots.delete(id)
conferbot.chatbots.duplicate(id)
// ── Responses ──
conferbot.responses.list(chatbotId, { page?, limit?, startDate?, endDate? })
conferbot.responses.get(chatbotId, responseId)
conferbot.responses.listAll(chatbotId, opts?) // async iterator
// ── Analytics ──
conferbot.analytics.get(chatbotId, { days? })
// ── Webhooks ──
conferbot.webhooks.list()
conferbot.webhooks.create({ chatbotId, url, events, description? })
conferbot.webhooks.delete(webhookId)
// ── Usage ──
conferbot.usage.get() // { month, plan, used, limit, remaining }Python
Installation
pip install conferbotRequirements
Python 3.8 or later. Single dependency: requests.
Quick start
import os
from conferbot import Conferbot
client = Conferbot(os.environ["CONFERBOT_API_KEY"])
# List chatbots
chatbots = client.list_chatbots()
for bot in chatbots:
print(f"{bot['name']} — {bot['responseCount']} responses")
# Get analytics
stats = client.get_analytics(chatbots[0]["id"], days=7)
print(f"{stats['recentResponses']} responses in the last 7 days")
# Create a chatbot
new_bot = client.create_chatbot("Support Bot", description="Handles inquiries")
print(f"Created: {new_bot['id']}")Auto-pagination
# Iterate through ALL responses — pages are fetched automatically
for response in client.iter_responses("chatbot_id"):
print(response["_id"], response["chatDate"])
# With date filters
for response in client.iter_responses(
"chatbot_id",
start_date="2025-01-01",
end_date="2025-01-31",
):
# process each response...
passWebhook verification
from flask import Flask, request
from conferbot import construct_webhook_event, ConferbotError
app = Flask(__name__)
WEBHOOK_SECRET = "your_webhook_secret"
@app.route("/webhook", methods=["POST"])
def handle_webhook():
try:
event = construct_webhook_event(
request.data,
request.headers.get("x-webhook-signature", ""),
WEBHOOK_SECRET,
)
print(f"Event: {event['event']}")
print(f"Data: {event['data']}")
return "OK", 200
except ConferbotError:
return "Invalid signature", 401Error handling
from conferbot import Conferbot, NotFoundError, RateLimitError
client = Conferbot("your_api_key")
try:
bot = client.get_chatbot("nonexistent_id")
except NotFoundError:
print("Chatbot not found")
except RateLimitError:
print("Rate limit exceeded — SDK already retried 3 times")All methods
# ── Chatbots ──
client.list_chatbots()
client.get_chatbot(chatbot_id)
client.create_chatbot(name, description="")
client.update_chatbot(chatbot_id, name=None, description=None, disabled=None)
client.delete_chatbot(chatbot_id)
client.duplicate_chatbot(chatbot_id)
# ── Responses ──
client.list_responses(chatbot_id, page=1, limit=20, start_date=None, end_date=None)
client.get_response(chatbot_id, response_id)
client.iter_responses(chatbot_id, limit=100, start_date=None, end_date=None) # generator
# ── Analytics ──
client.get_analytics(chatbot_id, days=30)
# ── Webhooks ──
client.list_webhooks()
client.create_webhook(chatbot_id, url, events, description=None)
client.delete_webhook(webhook_id)
# ── Usage ──
client.get_usage() # { "month", "plan", "used", "limit", "remaining" }cURL Examples
Quick reference for all endpoints using cURL. No SDK required — works with any HTTP client.
Tip: Use environment variables
Store your API key in an environment variable to avoid exposing it in your shell history: export API_KEY=your_key_here
List chatbots
curl -s "https://api-v2.conferbot.com/api/v1/external/v1/chatbots" \
-H "x-api-key: $API_KEY" | python3 -m json.toolGet chatbot details
curl -s "https://api-v2.conferbot.com/api/v1/external/v1/chatbots/$CHATBOT_ID" \
-H "x-api-key: $API_KEY" | python3 -m json.toolCreate a chatbot
curl -X POST "https://api-v2.conferbot.com/api/v1/external/v1/chatbots" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "My Bot", "description": "A helpful bot"}' | python3 -m json.toolGet responses (with date filter)
curl -s "https://api-v2.conferbot.com/api/v1/external/v1/chatbots/$CHATBOT_ID/responses?page=1&limit=50&startDate=2025-01-01&endDate=2025-01-31" \
-H "x-api-key: $API_KEY" | python3 -m json.toolGet analytics
curl -s "https://api-v2.conferbot.com/api/v1/external/v1/chatbots/$CHATBOT_ID/analytics?days=7" \
-H "x-api-key: $API_KEY" | python3 -m json.toolCreate a webhook
curl -X POST "https://api-v2.conferbot.com/api/v1/external/v1/webhooks" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatbotId": "'$CHATBOT_ID'",
"url": "https://your-server.com/webhook",
"events": ["response.created"]
}' | python3 -m json.toolDelete a webhook
curl -X DELETE "https://api-v2.conferbot.com/api/v1/external/v1/webhooks/$WEBHOOK_ID" \
-H "x-api-key: $API_KEY"Check API usage
curl -s "https://api-v2.conferbot.com/api/v1/external/v1/usage" \
-H "x-api-key: $API_KEY" | python3 -m json.tool