globall.dev globall.dev

Integration of Telegram bot with CRM: automatic collection and transfer of leads

Telegram bot and integration with CRM solve one expensive problem: between the chat where requests come in and the CRM where sales are carried out, there is usually a person with copy-paste. He reads the dialogue, makes a contact, rewrites the phone number, sets the stage of the funnel, adds a note. On ten leads this is annoying. In the flow, leads are simply lost: someone stayed in the chat and did not get to the CRM, someone was answered a day later, when he had already gone to a competitor. In this article, I’ll look at how to connect a Telegram bot with CRM so that each application ends up in the right stage of the funnel with a clear source - and what it costs.

We are not writing this as theorists: we put together exactly this combination in one of the studio’s projects and below we analyze it as a living example. This is not a review of the “top 5 services for integration”, but an engineering analysis of what actually works in production.

Why connect a Telegram bot with CRM at all?

Manual transfer of applications is not just “inconvenient”. He hits the money in three places at the same time:

  • Lost leads. An application that has not reached the CRM will not be included in the report, will not be assigned a task, and will be forgotten about. This is a wasted advertising budget.
  • Unknown source. If advertising is running in several channels, and in CRM all requests look the same “came from Telegram”, you do not understand which campaign is paying off. The budget is distributed based on feelings.
  • Slow first touch. While the lead is “warm”, he needs to respond in the first minutes. The manager does not sit in the chat around the clock - and the application cools down before hands reach it.

Proper integration removes all three pains at once. The principle by which we build such projects is simple: Telegram is a capture channel, CRM is a workplace. The bot does all the dirty work of delivering the lead to the funnel, and the operator continues to work where he is used to. We are not retraining anyone for the new interface.

How it works: architecture of the “bot → CRM” link

Full integration of a Telegram bot with CRM is divided into four circuits. They can be implemented separately and expanded gradually - from a simple lead bot to an end-to-end circuit with a Mini App.

1. Lead capture and qualification

Instead of endless chat dialogue, the client is given a structured form. In the case discussed below, this is a Telegram Mini App: name, phone number in E.164 format, business area, city, readiness scale from 1 to 10 and consent to data processing. As a result, the manager receives a qualified lead with filled in fields, and not a raw dialogue that still needs to be deciphered. For simple tasks, the usual inline form inside the bot is enough - without the Mini App.

2. Transferring an application to the funnel via CRM API v4

Once the form is submitted, according to the official CRM API v4 a contact and a deal are automatically created at the required stage of the funnel, and notes are added. The manager opens CRM and sees the finished card - he does not need to enter anything manually. An important detail: the connection needs to be built on API v4 with OAuth 2.0 and token auto-renewal, and not on fragile third-party connectors. This gives you control over the field structure and predictable behavior when there are more leads.

3. UTM source in custom transaction fields

The bot parses UTM tags from the deep link and writes them into custom deal fields. This way, for each lead in CRM, you can see what kind of advertising brought him in, and the budget can be transferred to what really pays off. This is perhaps the most underrated part of the integration: without it, you are paying for advertising blindly.

4. Auto funnel and two-way chat

While the manager is busy, the lead is guided by an auto-funnel of pre-configured messages - it catches the client in the first seconds. And two-way chat allows the operator to respond directly from the CRM card: the user’s messages come to CRM, the operator’s answers go back to Telegram. This is implemented through the amojo Chat API with HMAC signature.

Real example: lead bot with full CRM integration

So that this doesn’t sound like a theory, let’s look at a specific studio project - lead bot case with CRM integration. The task sounded like this: to build a circuit where the lead himself reaches the desired stage of the funnel with a clear source, receives an instant response, and the operator does not leave the usual CRM.

What ultimately works in production:

  • Application form in Mini App. Within a minute, the client leaves structured data that immediately goes into the transaction fields, instead of a dialogue that needs to be deciphered.
  • The application itself creates a deal. Using CRM API v4, a contact and a deal are created at the desired stage of the funnel, notes are added, UTM goes into custom fields. Zero manual transfer.
  • UTM in three formats. The bot parses tags from deep links in three options: simple source, key-value pairs and Base64-encoded query string. Plus a UTM link generator for marketers.
  • Auto funnel of 7 messages. Customizable delays (instantly → in a minute → in a day → next). As soon as the client fills out the form, the chain automatically stops so as not to duplicate live communication.
  • Two-way chat Telegram ↔ CRM. Client messages → notes and messages in CRM, operator responses directly from CRM → client in Telegram. Implemented using amojo Chat API with HMAC signature.
  • Admin panel. Dashboard with conversion statistics, UTM sources and a 14-day graph, auto funnel chain editor with media support, bot control (start / stop / restart) and instant notification for each new application.

Under the hood - Python and Aiogram for the bot, PHP and Mini App on the front, SQLite for storing leads, UTM, chains and tokens, webhook mode for Nginx with Let's Encrypt SSL. Specific figures for conversion and cost per lead are private client data and are provided upon request for a specific project; We do not provide fictitious metrics. Detailed analysis of the architecture - in full case.

How much does it cost to integrate a Telegram bot with CRM?

The price depends on the depth of the contour. A simple lead bot that transfers applications to CRM, and a full-fledged combination with Mini App, two-way chat and admin panel - these are projects of different scales. Below is a guide to studio rates. The estimate is fixed in the contract before the start, payment is staged, the source code is yours from the first day.

Level What's included Deadline Price
Starter Lead bot with a form and transfer of applications to CRM (contact + deal in the funnel), notification to the admin 5–7 days Quote on request
Business Lead qualification, UTM source in deal custom fields, auto funnel, UTM link generator 10–14 days Quote on request
Turnkey End-to-end circuit: Mini App, two-way chat via amojo, admin panel with dashboard and auto funnel editor 3–5 weeks Quote on request
Mini App/Product A full-fledged product based on a Mini App with a CRM outline, payment and complex business logic from 3–5 weeks Quote on request

If you are not sure what level is needed, describe the funnel, and we will send a fixed estimate and deadlines for your task within a day. Audit of an already working bot - separately, Quote on request.

Checklist: what proper integration should be able to do

Before ordering the “bot → CRM” bundle, check with this list that everything you need is included in the scope. This will protect you from a situation where the bot is “sort of integrated,” but half of the data is still entered manually.

  • Integration on the official CRM API v4, and not on a third-party interlayer connector.
  • OAuth 2.0 with token auto-renewal — the integration does not fall off when the token expires.
  • The deal is created at the right stage of the funnel, and not in the default “Unassembled”.
  • The UTM source is written in the custom fields of the transaction — you can see where the lead is coming from.
  • The phone is saved in E.164 formatso that CRM recognizes it correctly and does not create duplicate contacts.
  • Consent to data processing in the form - the correct fee in terms of 152-FZ.
  • Two-way chat, if the operator must respond from CRM, and not switch to Telegram.
  • Monitoring and notifications: for the fall of the bot and for each new application - so that the lead does not go unnoticed.

When you need not CRM, but Google Sheets or CRM

Not every business needs a full-fledged CRM. If you have 5-10 applications per day and a team of one, it is often enough for leads to fall into Google Sheet - it's cheaper and faster. CRM makes sense when there is a funnel with stages, several managers and you need analytics by sources. CRM - if you already have all your accounting on it. Good news: the mechanics of capturing and qualifying leads in Telegram are the same, only the integration layer with a specific API changes. Therefore, moving from Google Sheets to CRM later is an add-on, not a rewrite of the bot from scratch.

FAQ: frequently asked questions about bot integration with CRM

Which CRM API is used for integration with the Telegram bot?

We are building the connection on the official CRM API v4 with OAuth 2.0 and automatic token renewal. This gives control over the structure of transaction fields, predictable behavior as the load increases, and independence from fragile third-party connectors. Two-way chat is implemented via the amojo Chat API with HMAC signature.

Is it possible to transfer the UTM source of an application to the CRM funnel?

Yes. The bot parses UTM tags from the deep link and writes them into custom deal fields in CRM. The case supports three label formats: simple source, key-value pairs, and Base64-encoded query string. The kit includes a UTM link generator so that the marketer can collect tags for each campaign himself.

How much does it cost to integrate a Telegram bot with CRM?

A simple lead bot with application transfer to CRM - from USD 15,000 (5–7 days). A bot with qualifications, a UTM source in the transaction fields and an auto funnel - from USD 40,000 (10–14 days). Full-fledged circuit with Mini App, two-way chat and admin panel - from USD 75,000 (3-5 weeks). The estimate is fixed in the contract before the start.

Does this work with CRM or other CRMs, not just CRM?

Yes. The same logic - automatic deal creation, source transfer, auto funnel - is transferred to CRM, Google Sheets or another CRM. Only the integration layer with a specific API changes; The mechanics of capturing and qualifying leads in Telegram remain the same.

Can a manager respond to a client directly from CRM?

Yes, via two-way chat on the amojo Chat API. User messages from the Telegram bot come to the deal card as chat messages, and operator responses from CRM are delivered back to the client in Telegram. The operator does not leave the usual CRM.

Do you want leads to fall into your CRM themselves?

Describe the funnel - we will send you a fixed estimate and deadlines the day before. Lead collection, CRM integration, UTM source, auto funnel and two-way chat - we collect turnkey, the sources are yours from day one.

For free. We will respond within an hour during business hours. No spam.

Tariffs and prices Write to Telegram

We take on a limited number of projects at the same time - this keeps deadlines realistic.

IP Geolocation by DB-IP