BookbagBookbag
Developers

Build with the Bookbag API

A clean REST API and SDKs to send messages to your AI support agent, define custom actions, sync your knowledge, and react to events with webhooks.

support.js
// npm install @bookbag/sdk
import { Bookbag } from '@bookbag/sdk'

const bookbag = new Bookbag({ apiKey: process.env.BOOKBAG_API_KEY })

// Send a customer message to your AI agent and get a reply
const { reply, resolved, handoff } = await bookbag.chat({
  agentId: 'support-agent',
  conversationId: 'conv_123',
  message: 'Where is my order #1042?',
  customer: { email: 'sam@example.com' },
})

console.log(reply)       // grounded answer with live order status
console.log(resolved)    // true if the agent fully resolved it
console.log(handoff)     // set when the agent escalates to a human

What you can build

Chat API

Send customer messages and get grounded, action-taking replies for any surface — your app, kiosk, or backend.

Custom actions

Let the agent call your own endpoints (loyalty, warranty, OMS) with auth and guardrails you define.

Webhooks

React to handoffs, resolutions, CSAT, and tags in real time to sync with your stack.

Knowledge sync

Programmatically add and refresh knowledge sources so the agent always answers from current content.

Widget JS API

Open/close the widget, prefill customer identity, and pass page context for smarter answers.

Scoped keys

Issue scoped API keys per environment, with test keys and a sandbox agent for safe development.

Frequently Asked Questions

Start building with Bookbag

Join the ecommerce teams resolving more tickets, answering 24/7, and turning support into a revenue channel with Bookbag.