canonical: https://jentic.com/apis/chatbot.com/chatbot

# ChatBot API

Jentic publishes the only available OpenAPI specification for ChatBot API, keeping it validated and agent-ready. ChatBot.com is a flow-based chatbot builder where conversations are modelled as 'stories' - explicit branching scenarios - and the people who chat with the bot are tracked as users. The v2 API exposes 21 endpoints to manage stories, manage users (including segments and bans), export user data, and pull conversation reports such as message counts, averages, busiest-period heatmaps, and interaction popularity. Authentication is bearer-token using a developer access token.

## For AI agents

Manage ChatBot.com stories, users, and conversation reports. Bearer-authenticated REST API with 21 endpoints across story authoring, user/segment administration, and analytics.

## Scope

Does not handle live human-agent chat, telephony, or model training - use for ChatBot.com story authoring, user administration, and conversation reports only.

## Capabilities

- Author conversation flows by listing, creating, updating, and deleting stories via /v2/stories endpoints
- Maintain the user roster with create, read, update, and delete operations on /users
- Add, update, and remove segments on a user via /users/{id}/segments to drive targeted flows
- Ban or unban a user with PUT /users/{id}/ban for moderation
- Export the full user list with POST /users/export for CRM ingestion
- Pull conversation, paid-conversation, message, and average-conversation reports from /reports/conversations* endpoints
- Identify busiest-period traffic via GET /reports/conversations.heatmap and most-used flows via /reports/conversations.interactions

## Use cases

### Version-control conversation flows in CI

Treat ChatBot stories as code: pull the current set with GET /v2/stories, diff against a Git-tracked source of truth, and reconcile with PUT /v2/stories/{storyId} or POST /v2/stories. This lets a team review flow changes the same way they review application code and roll back a bad story without touching the ChatBot UI.

Example prompt: Pull all stories from ChatBot, compare to /repo/stories/*.json, and PUT any story whose JSON body differs from the live version

### Segment users for targeted flows

Use POST /users/{id}/segments to tag returning users (for example, 'paid', 'enterprise', or 'churn-risk') so downstream stories can branch on those tags. PUT and DELETE on the same path keep tags in sync as the underlying customer record changes. This is how a flow-based bot delivers different content to different audiences without bespoke per-user logic.

Example prompt: Add the segment 'enterprise' to user id 4321, then list segments for that user to confirm the tag was applied

### Build a weekly chatbot performance digest

Pull /reports/conversations, /reports/conversations.messages, /reports/conversations.avg, /reports/conversations.heatmap, and /reports/conversations.interactions every Monday morning to generate a weekly digest covering volume, message density, average length, busiest hour, and top interactions. The five endpoints share consistent date-range parameters so a single report function can serve all of them.

Example prompt: Fetch the five conversation reports for the prior 7 days and emit a summary listing total conversations, average length, busiest hour, and the top three interactions

### Drive a ChatBot.com bot from an AI agent

An AI agent uses Jentic to discover ChatBot's story and user endpoints, loads their schemas, and creates or updates flows in response to a natural-language brief like 'add a refund-request branch to the support story'. Bearer-token credentials sit in Jentic's vault so the agent never sees the developer access token.

Example prompt: Search Jentic for 'create a chatbot story', load the schema, and create a story whose name is 'Refund Request Flow' with the refund-handling branches the user described

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v2/stories | Create a new story |
| PUT | /v2/stories/{storyId} | Update an existing story |
| GET | /users | List users |
| POST | /users/{id}/segments | Add segments to a user |
| PUT | /users/{id}/ban | Ban or unban a user |
| POST | /users/export | Export users |
| GET | /reports/conversations | Get conversations report |
| GET | /reports/conversations.heatmap | Get busiest-period heatmap report |

## Key resources

- **Stories** — List, create, retrieve, update, and delete chatbot stories
- **Users** — Manage end-users who chat with the bot
- **Segments** — Tag and re-tag users for targeted flow branching
- **Bans** — Ban or unban users via PUT /users/{id}/ban
- **User Exports** — Trigger a full user export for CRM ingestion
- **Reports** — Conversation, message, average, heatmap, and interactions reports

## Why Jentic

- **Setup:** Wiring the ChatBot API by hand means learning its bearer token auth and attaching the token to every story, user, and report call yourself. Through Jentic you install once, import ChatBot from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** ChatBot puts the story and user ids in the URL path (/v2/stories/{storyId}, /users/{id}/...), so a rule can pin your agent to a given story or user and nothing else. You choose the operations it may call, so banning a user or exporting users is not included unless you add it.
- **Credential handling:** Your ChatBot developer access token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a chatbot story' or 'export chatbot users', and Jentic returns the matching ChatBot operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Chatbase API** — Chatbase is doc-grounded LLM chatbots - choose it over ChatBot.com when answers should come from uploaded content rather than scripted flows.
- **Chatfuel API** — Chatfuel targets messenger-channel bots - choose it for Facebook/Instagram-first deployments.
- **ChatKitty API** — ChatKitty provides real-time chat infrastructure - pair it with ChatBot.com to add bot replies inside human chat channels.

## FAQ

### Why is there no official OpenAPI spec for ChatBot API?

ChatBot.com does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call ChatBot API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the ChatBot API use?

ChatBot.com uses HTTP bearer-token authentication with a developer access token. Send 'Authorization: Bearer <token>' against api.chatbot.com. Through Jentic, the token sits in your encrypted Jentic One instance so it never enters the agent's prompt.

### Can I create or update conversation flows with the ChatBot API?

Yes. POST /v2/stories creates a new story and PUT /v2/stories/{storyId} updates an existing one. Stories define the branching conversation logic, so editing them through the API is the right way to script flow changes from CI rather than the visual editor.

### How do I tag users for personalised flows?

Call POST /users/{id}/segments with a list of tag names to attach. Use PUT /users/{id}/segments to replace the full set and DELETE /users/{id}/segments to remove specific tags. Stories can branch on these segments to deliver different content to different audiences.

### How do I export the user list through Jentic?

Run pip install jentic, set JENTIC_AGENT_API_KEY, then search 'export chatbot users'. Jentic returns POST /users/export with its request schema. Execute the call and ChatBot.com returns the export - the agent can then forward it to a CRM.

### What conversation reports are available?

Six reports: GET /reports/conversations (volume), .paid (paid conversations), .messages (message density), .avg (average length), .heatmap (busiest period), and .interactions (interaction popularity). They share date-range query parameters so a single report function can drive all of them.

### Can I limit what my agent is allowed to do with the ChatBot API?

Yes. Jentic One is self-hosted by you, so your own rules decide which ChatBot operations and credentials the agent may use. Because ChatBot puts the story and user ids in the URL path (/v2/stories/{storyId}, /users/{id}/segments), you can pin the agent to a single story or user and let it call read or update endpoints while nothing else is exposed. Sensitive operations like PUT /users/{id}/ban or POST /users/export stay off limits unless you explicitly grant them.
