> ## 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

<Frame caption="Bot overview showing channels, integrations, and settings">
  <img src="https://mintcdn.com/chatbotplatform/QhGUbEN05MzAjt2K/images/screenshots/01-getting-started/06_bot_overview.png?fit=max&auto=format&n=QhGUbEN05MzAjt2K&q=85&s=0a1e40bb0707bbe02bc8979f2ddcd71e" alt="Bot overview page" width="1920" height="941" data-path="images/screenshots/01-getting-started/06_bot_overview.png" />
</Frame>

## Creating a Bot

<Steps>
  <Step title="Navigate to Bots">
    From your dashboard, click **Bots** in the sidebar.

    <Frame caption="Empty bots page">
      <img src="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" alt="Bots page" width="1920" height="941" data-path="images/screenshots/01-getting-started/02_bots_page_empty.png" />
    </Frame>
  </Step>

  <Step title="Fill in Details">
    Click **Create Bot** and provide:

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

    <Frame caption="Create bot form">
      <img src="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" alt="Create bot form" width="1920" height="941" data-path="images/screenshots/01-getting-started/03_create_bot_form.png" />
    </Frame>
  </Step>

  <Step title="Configure Settings">
    After creation, you'll see the bot overview where you can configure behaviors, add integrations, and connect channels.

    <Frame caption="Newly created bot">
      <img src="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" alt="Bot created successfully" width="1920" height="941" data-path="images/screenshots/01-getting-started/05_bot_created_success.png" />
    </Frame>
  </Step>
</Steps>

## Bot Components

### Behaviors

Control how your bot interacts with users:

<CardGroup cols={2}>
  <Card title="Typing Indicators" icon="message-dots" href="/bots/behaviors/typing-indicators">
    Show "thinking" messages while generating responses
  </Card>

  <Card title="Should Respond Detection" icon="magnifying-glass" href="/bots/behaviors/should-respond">
    Determine which messages belong together in a conversation
  </Card>
</CardGroup>

### Integrations

Connect your bot to AI backends:

<CardGroup cols={2}>
  <Card title="Webhook Setup" icon="webhook" href="/bots/integrations/webhook-setup">
    Configure connections to OpenAI, Anthropic, or custom APIs
  </Card>

  <Card title="A/B Testing" icon="flask" href="/bots/integrations/ab-testing">
    Compare multiple AI backends with weighted distribution
  </Card>

  <Card title="Custom Headers" icon="key" href="/bots/integrations/custom-headers">
    Add authentication and custom headers to requests
  </Card>
</CardGroup>

### Channels

Deploy your bot to messaging platforms:

<CardGroup cols={2}>
  <Card title="Telegram" icon="telegram" href="/bots/channels/telegram">
    Connect to Telegram with bot tokens
  </Card>

  <Card title="Slack" icon="slack" href="/bots/channels/slack">
    Integrate with Slack workspaces
  </Card>

  <Card title="Discord" icon="discord" href="/bots/channels/discord">
    Deploy to Discord servers (coming soon)
  </Card>
</CardGroup>

### Conversations

Manage message history and context:

<CardGroup cols={2}>
  <Card title="Conversation Overview" icon="messages" href="/bots/conversations/index">
    View and manage bot conversations
  </Card>

  <Card title="Message History" icon="clock-rotate-left" href="/bots/conversations/message-history">
    Configure context window size
  </Card>
</CardGroup>

## 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.

<AccordionGroup>
  <Accordion title="Create a bot via API">
    <Tabs>
      <Tab title="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>

      <Tab title="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>

      <Tab title="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>

      <Tab title="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)
        ```
      </Tab>
    </Tabs>
  </Accordion>

  <Accordion title="List all bots">
    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl https://api.chatbotplatform.io/v1/bots \
          -H "Authorization: Bearer YOUR_API_KEY"
        ```
      </Tab>

      <Tab title="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>

      <Tab title="PHP">
        ```php theme={null}
        $response = Http::withToken('YOUR_API_KEY')
            ->get('https://api.chatbotplatform.io/v1/bots');

        $bots = $response->json('data');
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        response = requests.get(
            'https://api.chatbotplatform.io/v1/bots',
            headers={'Authorization': 'Bearer YOUR_API_KEY'}
        )
        bots = response.json()['data']
        ```
      </Tab>
    </Tabs>
  </Accordion>

  <Accordion title="Update a bot">
    <Tabs>
      <Tab title="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>

      <Tab title="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>

      <Tab title="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>

      <Tab title="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'
            }
        )
        ```
      </Tab>
    </Tabs>
  </Accordion>

  <Accordion title="Delete a bot">
    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl -X DELETE https://api.chatbotplatform.io/v1/bots/bot_123 \
          -H "Authorization: Bearer YOUR_API_KEY"
        ```
      </Tab>

      <Tab title="JavaScript">
        ```javascript theme={null}
        await fetch('https://api.chatbotplatform.io/v1/bots/bot_123', {
          method: 'DELETE',
          headers: {
            'Authorization': 'Bearer YOUR_API_KEY'
          }
        });
        ```
      </Tab>

      <Tab title="PHP">
        ```php theme={null}
        Http::withToken('YOUR_API_KEY')
            ->delete('https://api.chatbotplatform.io/v1/bots/bot_123');
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        requests.delete(
            'https://api.chatbotplatform.io/v1/bots/bot_123',
            headers={'Authorization': 'Bearer YOUR_API_KEY'}
        )
        ```
      </Tab>
    </Tabs>
  </Accordion>
</AccordionGroup>

<Card title="Complete API Reference" icon="code" href="https://app.chatbotplatform.io/openapi">
  View the full API specification with all endpoints, parameters, and response schemas.
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Configure Behaviors" icon="sliders" href="/bots/behaviors/index">
    Customize how your bot responds
  </Card>

  <Card title="Add Integrations" icon="webhook" href="/bots/integrations/index">
    Connect AI backends
  </Card>

  <Card title="Connect Channels" icon="plug" href="/bots/channels/index">
    Deploy to messaging platforms
  </Card>

  <Card title="View Conversations" icon="messages" href="/bots/conversations/index">
    See bot conversations and history
  </Card>
</CardGroup>
