# imbot.v2.Bot.list

URL: https://chugunov.pro/api-bitrix24/chat-bots/chat-bots-v2/imbot.v2/bots/bot-list/
Проверено на Битрикс24 REST API, обновлено 11.09.2026 (ревизия источника fb39d6c).
Источник: официальная документация Битрикс24 (bitrix-tools/b24-rest-docs, лицензия MIT, © Bitrix). Справочник независимый, официальной документацией не является.

Список ботов приложения
Scope: `imbot`
Кто может выполнять метод: владелец зарегистрированного бота

## Описание

Метод `imbot.v2.Bot.list` возвращает список ботов текущего приложения в расширенном формате.

## Параметры

- `botToken` `string` — необязательный. Уникальный токен авторизации бота. Обязателен при авторизации через вебхук, не нужен для OAuth.
  Передавайте тот же botToken, который был указан при регистрации чат-бота
- `filter` `object` — необязательный. Фильтр результатов.
  Доступные поля фильтра:
  - `type` — тип бота. Описание типов — [Типы ботов](https://chugunov.pro/api-bitrix24/chat-bots/chat-bots-v2/#bot-types)
- `limit` `integer` — необязательный. Количество ботов на страницу. По умолчанию `50`
- `offset` `integer` — необязательный. Смещение для пагинации. По умолчанию `0`

## Ответ

HTTP-статус: 200

```json
{
    "result": {
        "bots": [
            {
                "id": 456,
                "code": "support_bot",
                "type": "bot",
                "isHidden": false,
                "isSupportOpenline": false,
                "isReactionsEnabled": true,
                "backgroundId": null,
                "language": "ru",
                "moduleId": "rest",
                "eventMode": "fetch",
                "countMessage": 150,
                "countCommand": 3,
                "countChat": 12,
                "countUser": 45
            }
        ],
        "users": [
            {
                "id": 456,
                "active": true,
                "name": "Support Bot",
                "bot": true,
                "type": "bot"
            }
        ],
        "hasNextPage": false
    },
    "time": {
        "start": 1728626400.123,
        "finish": 1728626400.234,
        "duration": 0.111,
        "processing": 0.045,
        "date_start": "2024-10-11T10:00:00+03:00",
        "date_finish": "2024-10-11T10:00:00+03:00"
    }
}
```


## Ошибки

HTTP-статус: 400

```json
{
    "error": "BOT_TOKEN_NOT_SPECIFIED",
    "error_description": "Bot token is not specified"
}
```

- `BOT_TOKEN_NOT_SPECIFIED` — Bot token is not specified. Не указан `botToken`. Обязателен при авторизации через вебхук

## Примеры запроса

### cURL (Webhook)

```bash
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"botToken":"my_bot_token","filter":{"type":"bot"},"limit":10}' \
  https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/imbot.v2.Bot.list
```

### cURL (OAuth)

```bash
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"filter":{"type":"bot"},"limit":10,"auth":"**put_access_token_here**"}' \
  https://**put_your_bitrix24_address**/rest/imbot.v2.Bot.list
```

### JS

```js
try {
  const response = await $b24.callMethod('imbot.v2.Bot.list', {
    filter: { type: 'bot' },
    limit: 10,
  });

  const { result } = response.getData();
  console.log('result:', result);
} catch (error) {
  console.error('Error:', error);
}
```

### Python

```python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException

try:
    bitrix_response = client.imbot.v2.bot.list(
        filter={
            "type": "bot",
        },
        limit=10,
    ).response
    result = bitrix_response.result
    print(result)
except BitrixAPIError as error:
    print(
        "Ошибка Bitrix API",
        f"error: {error.error}",
        f"error_description: {error.error_description}",
        sep="\n",
    )
except BitrixSDKException as error:
    print(f"Ошибка Bitrix SDK: {error.message}")
except Exception as error:
    print(f"Непредвиденная ошибка: {error}")
```

### PHP

```php
try {
    $response = $b24Service
        ->core
        ->call(
            'imbot.v2.Bot.list',
            [
                'filter' => ['type' => 'bot'],
                'limit' => 10,
            ]
        );

    $result = $response
        ->getResponseData()
        ->getResult();

    echo 'result: '. print_r($result, true);
} catch (Throwable $exception) {
    error_log($exception->getMessage());
    echo 'Error: '. $exception->getMessage();
}
```

### BX24.js

```js
BX24.callMethod(
    'imbot.v2.Bot.list',
    {
        filter: { type: 'bot' },
        limit: 10,
    },
    function(result) {
        if (result.error()) {
            console.error(result.error().ex);
        } else {
            console.log(result.data());
        }
    }
);
```

### PHP CRest

```php
require_once('crest.php');

$result = CRest::call(
    'imbot.v2.Bot.list',
    [
        'filter' => ['type' => 'bot'],
        'limit' => 10,
    ]
);

if (!empty($result['error'])) {
    echo 'Error: '. $result['error_description'];
} else {
    foreach ($result['result']['bots'] as $bot) {
        echo $bot['id']. ': '. $bot['code']. "\n";
    }
}
```

### Go

```go
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "imbot.v2.Bot.list", b24.Params{
	"botToken": "my_bot_token",
	"filter": b24.Params{
		"type": "bot",
	},
	"limit": 10,
}, b24.WithIdempotent())
if err != nil {
	return fmt.Errorf("imbot.v2.Bot.list: %w", err)
}

var item struct {
	HasNextPage bool `json:"hasNextPage"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
	return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.HasNextPage)
```

Оригинал в официальной документации: https://apidocs.bitrix24.ru/api-reference/chat-bots/chat-bots-v2/imbot.v2/bots/bot-list.html
