Telegram Bot with Bitrix24 Integration: Automate Sales & Support

When a client writes in Telegram and the operator is busy — response time grows Let me illustrate: a client wants to know order status, but the operator is already talking to someone else. While switching, the client waits minutes. If this repeats dozens of times a day — both time and nerves are

Our competencies:

Frequently Asked Questions

When a client writes in Telegram and the operator is busy — response time grows

Let me illustrate: a client wants to know order status, but the operator is already talking to someone else. While switching, the client waits minutes. If this repeats dozens of times a day — both time and nerves are lost. We automate such scenarios using a bot integrated with Bitrix24 via REST API. The bot handles standard requests in seconds: checks status, books services, sends notifications. The operator handles only complex questions.

This approach reduces call center load and speeds up service without extra staff. Integration via REST API allows the bot to work directly with CRM, tasks, and calendar — no intermediaries.

How the bot integrates with Bitrix24?

There are two approaches. First — via Bitrix24 Open Lines: the bot connects in the Contact Center → Open Lines → Connect channels → Telegram section. Messages go to the operator queue. Simple setup, but the bot is a relay. Second — a standalone bot on a separate server: it receives messages via Telegram Bot API (webhook), processes scenarios itself, and calls Bitrix24's REST API. Full control over logic.

Criteria Open Lines Standalone bot
Scenario flexibility Minimal Maximum
CRM integration Chat only Full REST API
Processing speed Depends on operator (slower) Instant (10x faster)
Implementation cost Free Custom

Why a standalone bot is more reliable than Open Lines?

Open Lines lack flexibility when automation is needed (creating leads, checking statuses, booking services). A standalone bot opens access to CRM, tasks, and calendar via REST API. We use Python + aiogram 3, Redis for states, PostgreSQL for logs. Webhooks are secured with a secret token.

According to Telegram Bot API documentation, webhooks are the preferred method for real-time updates.

Architecture of the standalone bot

Client in Telegram ↓ Telegram Bot API (webhook) ↓ Bot server (Python aiogram / Node.js telegraf) ↓ ↓ ↓ Logic Bitrix24 REST API External services bot (crm.*, im.*, tasks.*) (1C, warehouse, etc.) 

The server receives an update from Telegram, determines user intent (FSM or NLP), executes required actions in Bitrix24, returns a response to Telegram.

Key integration points with Bitrix24

Client identification

On first contact, the bot requests a phone number via KeyboardButton(request_contact=True). The obtained number is used to search for a contact in CRM: crm.contact.list with filter PHONE. If found — links telegram_id to UF_CRM_TELEGRAM_ID. If not — creates a new contact.

Creating leads and deals

Each new inquiry creates a lead: crm.lead.add with SOURCE_ID = 'MESSENGER' and UTM_SOURCE = 'telegram'. All messages are written to the lead comment via crm.timeline.comment.add.

Order status

The bot takes an order number → makes a request crm.deal.list by UF_ORDER_NUMBER → returns the stage and expected date. The client gets a response in 2-3 seconds without an operator.

Service booking

The bot shows available slots from Bitrix24's Schedule module via calendar.accessibility.get → client selects time → creates an appointment calendar.event.add linked to the contact.

Transferring complex requests to an operator

If the bot cannot process a request, it transfers to an operator. Correct implementation:

  1. The bot saves dialog history (last N messages) in Redis.
  2. Creates an Open Lines conversation via imopenlines.crm.chat.getLink or direct chat creation via im.chat.add.
  3. Sends history as the first message so the operator sees context.
  4. The client continues in Telegram, the operator replies from Bitrix24.
Case Study: Car Service Chain

From our practice: a chain of 12 car service centers, clients want to book maintenance via Telegram, check car readiness, receive invoices.

Bot scenarios:

  • Book maintenance → select location (inline buttons) → select service → select date/time from Bitrix24 schedule → confirm → SMS reminder one day before.
  • Repair status → enter car plate → request to crm.deal.list by UF_CAR_NUMBER → current stage from deal stage.
  • Car ready → automatic notification when stage changes to "Ready for pickup" (trigger via crm.deal.onUpdate → webhook to bot server → bot.send_message).

Tech stack: Python + aiogram 3 + Redis (FSM) + PostgreSQL (logging) + Bitrix24 REST.

Problem: Telegram limits send frequency — no more than 30 messages per second across different chats. For mass notifications, a queue with delays is needed. Solved via Redis queue with throttling.

Result: Client booking time reduced from 5 minutes to 30 seconds — that's 10 times faster than manual handling. Call center load dropped by 70%. Operator savings exceed $50,000 per year for a 12-location chain.

What's included in the work

  • Architecture and scenario design (FSM, integration points).
  • Server-side development (Python/Node.js) using Telegram Bot API and Bitrix24's REST API.
  • Webhook setup, deployment (Docker, Nginx, SSL).
  • Testing all scenarios: identification, booking, status, operator transfer.
  • Monitoring and error logging (Sentinel, Prometheus).
  • Operations documentation and team training.

Estimated timelines

Stage Time
Design 4–8 h
Basic bot development + webhook 8–16 h
CRM integration (identification, leads) 8–16 h
FSM scenarios (booking, status) 16–32 h
Bitrix24 Schedule integration 8–16 h
Outgoing notifications + queue 8–16 h
Deployment, SSL, monitoring 4–8 h
Total 56–112 h

Development investment for such a bot typically ranges from $3,000 to $6,000, depending on complexity.

Our team's experience is backed by dozens of successful projects. We guarantee stable 24/7 bot operation. Contact us to discuss details. Request a consultation — we'll evaluate your project in one day. Get a consultation and start automating today.