> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatbotplatform.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Bots

> Build and manage AI-powered chatbots

Bots are the core of Chatbot Platform. They connect your AI backends to messaging platforms, manage conversations, and provide a seamless experience for your users.

## Overview

A bot is a configured instance that:

* **Connects to Channels**: Links to one or more messaging platforms (Telegram, Slack, Discord)
* **Uses Integrations**: Forwards messages to AI backends for response generation
* **Manages Conversations**: Tracks message history and context
* **Applies Behaviors**: Controls typing indicators, message detection, and response formatting

### Team Ownership

Every bot belongs to a team. Team members can:

* View and manage all team bots
* Configure integrations and channels
* Access conversation history
* Invite other team members with appropriate permissions

Bots are isolated per team - you only see bots created by your team.

## How Bots Work

When a user sends a message to your bot:

1. **Message Received**: The channel (Telegram, Slack, etc.) forwards the message to Chatbot Platform
2. **Reply Detection**: Bot checks if it should respond based on behavior settings (mentions, DMs, etc.)
3. **Typing Indicator**: Bot shows "typing..." if enabled
4. **Context Building**: Bot retrieves recent conversation history based on `history_limit` setting
5. **Integration Call**: Bot sends message + history to your AI integration webhook
6. **Response Generated**: Your integration processes the request and returns a response
7. **Message Sent**: Bot sends the response back through the channel to the user

This flow happens in seconds, providing a seamless conversational experience.

![Bot overview page](https://mintcdn.com/chatbotplatform/QhGUbEN05MzAjt2K/images/screenshots/01-getting-started/06_bot_overview.png?fit=max\&auto=format\&n=QhGUbEN05MzAjt2K\&q=85\&s=0a1e40bb0707bbe02bc8979f2ddcd71e)

Bot overview showing channels, integrations, and settings

## Creating a Bot

**1. Navigate to Bots**

From your dashboard, click **Bots** in the sidebar.

![Bots page](https://mintcdn.com/chatbotplatform/QhGUbEN05MzAjt2K/images/screenshots/01-getting-started/02_bots_page_empty.png?fit=max\&auto=format\&n=QhGUbEN05MzAjt2K\&q=85\&s=6233aba5bb0b6d11546d1362abbe8d8a)

Empty bots page

**2. Fill in Details**

Click **Create Bot** and provide:

* **Name**: A friendly name for internal reference
* **Description**: Optional description of the bot's purpose

![Create bot form](https://mintcdn.com/chatbotplatform/QhGUbEN05MzAjt2K/images/screenshots/01-getting-started/03_create_bot_form.png?fit=max\&auto=format\&n=QhGUbEN05MzAjt2K\&q=85\&s=0d7a8d37b31f44d34d8a24661a1763c9)

Create bot form

**3. Configure Settings**

After creation, you'll see the bot overview where you can configure behaviors, add integrations, and connect channels.

![Bot created successfully](https://mintcdn.com/chatbotplatform/QhGUbEN05MzAjt2K/images/screenshots/01-getting-started/05_bot_created_success.png?fit=max\&auto=format\&n=QhGUbEN05MzAjt2K\&q=85\&s=f92dbc4299b0fe2f006d472658c85207)

Newly created bot

## Bot Components

### Behaviors

Control how your bot interacts with users:

> [card] [Typing Indicators](https://docs.chatbotplatform.io/bots/behaviors/typing-indicators.md)
>
> Show "thinking" messages while generating responses

> [card] [Reply Detection](https://docs.chatbotplatform.io/bots/behaviors/reply-detection.md)
>
> Control when bot responds to messages

> [card] [Response Timing](https://docs.chatbotplatform.io/bots/behaviors/response-timing)
>
> Configure natural response delays

> [card] [Should Respond](https://docs.chatbotplatform.io/bots/behaviors/should-respond)
>
> Detect when bot should reply in groups

### Integrations

Connect your bot to AI backends:

> [card] [Webhook Setup](https://docs.chatbotplatform.io/bots/integrations/webhook-setup)
>
> Configure connections to OpenAI, Anthropic, or custom APIs

> [card] [Webhook Payload](https://docs.chatbotplatform.io/bots/integrations/webhook-payload.md)
>
> Complete payload reference with examples

> [card] [Async Replies](https://docs.chatbotplatform.io/bots/integrations/async-replies.md)
>
> Handle long-running operations

> [card] [A/B Testing](https://docs.chatbotplatform.io/bots/integrations/ab-testing)
>
> Compare multiple AI backends with weighted distribution

> [card] [Custom Headers](https://docs.chatbotplatform.io/bots/integrations/custom-headers)
>
> Add authentication and custom headers to requests

### Channels

Deploy your bot to messaging platforms:

> [card] [Telegram](https://docs.chatbotplatform.io/bots/channels/telegram.md)
>
> Connect to Telegram with bot tokens

> [card] [Slack](https://docs.chatbotplatform.io/bots/channels/slack.md)
>
> Integrate with Slack workspaces

> [card] [Discord](https://docs.chatbotplatform.io/bots/channels/discord)
>
> Deploy to Discord servers (coming soon)

> [card] [Adding Channels](https://docs.chatbotplatform.io/bots/channels/adding-channels.md)
>
> How to add new channel types

### Conversations

Manage message history and context:

> [card] [Conversation Overview](https://docs.chatbotplatform.io/bots/conversations/index.md)
>
> View and manage bot conversations

> [card] [Message History](https://docs.chatbotplatform.io/bots/conversations/history.md)
>
> Configure context window and history\_limit

> [card] [Conversation API](https://docs.chatbotplatform.io/bots/conversations/api.md)
>
> Programmatic conversation management

## Default Integration

Every bot comes with a default "echo" integration that simply returns the user's message. This is useful for:

* Testing channel setup before connecting a real AI backend
* Debugging webhook delivery
* Understanding message flow

Replace the echo integration with a real AI backend when you're ready.

## Multiple Channels

A single bot can be connected to multiple channels simultaneously. This allows you to:

* Deploy the same bot across Telegram, Slack, and Discord
* Use one AI backend for all platforms
* Maintain separate conversation contexts per platform
* Centralize bot management

## Bot Settings

Configure these settings for each bot:

| Setting | Description | Default |
| - | - | - |
| Name | Display name for internal reference | Required |
| Description | Optional purpose description | Empty |
| Typing Indicators | Show "thinking" messages | Enabled |
| Message Detection | Conversation grouping strategy | Platform-specific |
| Context Window | Number of messages to include | 10 |

## API Access

Manage bots programmatically using the API.

> [accordion] Create a bot via API
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl -X POST https://api.chatbotplatform.io/v1/bots \
> >   -H "Authorization: Bearer YOUR_API_KEY" \
> >   -H "Content-Type: application/json" \
> >   -d '{
> >     "name": "My Bot",
> >     "description": "A helpful AI assistant"
> >   }'
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch('https://api.chatbotplatform.io/v1/bots', {
> >   method: 'POST',
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY',
> >     'Content-Type': 'application/json'
> >   },
> >   body: JSON.stringify({
> >     name: 'My Bot',
> >     description: 'A helpful AI assistant'
> >   })
> > });
> > const data = await response.json();
> > console.log(data);
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > use Illuminate\Support\Facades\Http;
> >
> > $response = Http::withToken('YOUR_API_KEY')
> >     ->post('https://api.chatbotplatform.io/v1/bots', [
> >         'name' => 'My Bot',
> >         'description' => 'A helpful AI assistant'
> >     ]);
> >
> > $bot = $response->json();
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > import requests
> >
> > response = requests.post(
> >     'https://api.chatbotplatform.io/v1/bots',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'},
> >     json={
> >         'name': 'My Bot',
> >         'description': 'A helpful AI assistant'
> >     }
> > )
> > bot = response.json()
> > print(bot)
> > ```

> [accordion] List all bots
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl https://api.chatbotplatform.io/v1/bots \
> >   -H "Authorization: Bearer YOUR_API_KEY"
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch('https://api.chatbotplatform.io/v1/bots', {
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY'
> >   }
> > });
> > const { data } = await response.json();
> > console.log(data);
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > $response = Http::withToken('YOUR_API_KEY')
> >     ->get('https://api.chatbotplatform.io/v1/bots');
> >
> > $bots = $response->json('data');
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > response = requests.get(
> >     'https://api.chatbotplatform.io/v1/bots',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'}
> > )
> > bots = response.json()['data']
> > ```

> [accordion] Update a bot
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl -X PATCH https://api.chatbotplatform.io/v1/bots/bot_123 \
> >   -H "Authorization: Bearer YOUR_API_KEY" \
> >   -H "Content-Type: application/json" \
> >   -d '{
> >     "name": "Updated Bot Name",
> >     "description": "New description"
> >   }'
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch('https://api.chatbotplatform.io/v1/bots/bot_123', {
> >   method: 'PATCH',
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY',
> >     'Content-Type': 'application/json'
> >   },
> >   body: JSON.stringify({
> >     name: 'Updated Bot Name',
> >     description: 'New description'
> >   })
> > });
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > $response = Http::withToken('YOUR_API_KEY')
> >     ->patch('https://api.chatbotplatform.io/v1/bots/bot_123', [
> >         'name' => 'Updated Bot Name',
> >         'description' => 'New description'
> >     ]);
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > response = requests.patch(
> >     'https://api.chatbotplatform.io/v1/bots/bot_123',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'},
> >     json={
> >         'name': 'Updated Bot Name',
> >         'description': 'New description'
> >     }
> > )
> > ```

> [accordion] Delete a bot
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl -X DELETE https://api.chatbotplatform.io/v1/bots/bot_123 \
> >   -H "Authorization: Bearer YOUR_API_KEY"
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > await fetch('https://api.chatbotplatform.io/v1/bots/bot_123', {
> >   method: 'DELETE',
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY'
> >   }
> > });
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > Http::withToken('YOUR_API_KEY')
> >     ->delete('https://api.chatbotplatform.io/v1/bots/bot_123');
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > requests.delete(
> >     'https://api.chatbotplatform.io/v1/bots/bot_123',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'}
> > )
> > ```

> [card] [Complete API Reference](https://app.chatbotplatform.io/openapi)
>
> View the full API specification with all endpoints, parameters, and response schemas.

## Next Steps

> [card] [Configure Behaviors](https://docs.chatbotplatform.io/bots/behaviors/index.md)
>
> Customize how your bot responds

> [card] [Add Integrations](https://docs.chatbotplatform.io/bots/integrations/index.md)
>
> Connect AI backends

> [card] [Connect Channels](https://docs.chatbotplatform.io/bots/channels/index.md)
>
> Deploy to messaging platforms

> [card] [View Conversations](https://docs.chatbotplatform.io/bots/conversations/index.md)
>
> See bot conversations and history


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.