Telegram and Bitrix24 integration: bot messages become leads

The Telegram and Bitrix24 integration in nana800 turns a message to your bot into a lead: the trigger catches the message, the Bitrix24 block creates a lead with the customer name and text, and the bot replies with the request number. You need a bot token from @BotFather and a Bitrix24 inbound webhook address, no code. The message and the reply cost as much as a basic block, the Bitrix24 request twice as much.

Build it in the builder

What you can automate

  • Create a lead for every message to the bot, with the customer name in the card and the message in the comment
  • Reply to the customer with the request number: the Bitrix24 block returns the new lead ID
  • Give a colleague a task straight from a team bot with the add_task operation, a title and an assignee
  • Create a contact and a deal in the right pipeline: add_contact returns the contact ID for add_deal
  • Skip empty leads: the free condition block ignores the /start command that arrives when someone presses Start

How to set it up

  1. 1

    Create an inbound webhook in Bitrix24

    In Bitrix24 open Developer resources, then Other and Inbound webhook. Tick the CRM permission (and Tasks if you need tasks), save and copy the webhook address. If the item is missing, the portal admin has to enable it. Keep the address secret: it gives access to data with the rights of the employee who created it.

  2. 2

    Add the incoming message trigger

    Create a scheme, add the Telegram message from user to bot trigger and paste the bot token from @BotFather. Choose message as the event type, so leads are created only from messages.

  3. 3

    Create a lead with the Bitrix24 block

    Add the Bitrix24 block, paste the webhook address and choose the add_lead operation. Set the title to "Telegram request", put the sender name from the trigger into the name field and the message text into the comment field. The responsible employee ID decides who gets the lead.

  4. 4

    Reply with the request number

    Add the Telegram message send block with the same bot token. Put chat_id from the trigger into the chat ID field and write "Thank you, your request number is" followed by record_id from the Bitrix24 block.

  5. 5

    Test it with the button trigger

    Connect the button trigger to the Bitrix24 block, temporarily replace the trigger data with test values and put your own ID from @getmyid_bot into the chat ID field. Turn the scheme on and press the button: the lead appears in Bitrix24 and the reply arrives in Telegram.

  6. 6

    Filter out /start and keep the scheme on

    Pressing Start sends the bot a /start message, which would also create a lead. Put the free condition block after the trigger: if the text equals /start, the bot only says hello, otherwise it creates the lead. Put the trigger data back instead of the test values and keep the scheme on. While it is on, it costs $0.0042 per hour.

Pricing

A run of a Telegram block costs $0.001, a run of a Bitrix24 block costs $0.002. Every month the balance is topped up to $3.50 for free, an enabled scheme costs $0.0042 per hour.

Services in this connection

  • Telegram

    Build a Telegram bot without code: reply to messages, add buttons, send leads and alerts to a chat, group or channel. Free balance every month, no card needed.

  • Bitrix24

    Connect Bitrix24 without code: website leads become CRM leads and deals, and tasks are assigned to your team for you. Free balance every month, no card needed.

Frequently asked questions

One lead is the trigger and the customer reply at the basic block price ($1 per 1,000 runs) plus the Bitrix24 request at twice that price. The condition block is free. An enabled scheme costs $0.0042 per hour, and your balance is topped up to $3.50 for free every month. A scheme kept on around the clock spends most of that on hours.

Under Developer resources, Other, Inbound webhook. Tick the CRM and Tasks permissions and copy the address. Do not share it: if it leaks, delete the webhook and create a new one. nana800 hides it in logs and scheme exports.

Yes, with the add_deal operation. You can link the deal to a contact through the contact ID (the add_contact operation returns it) and choose a pipeline by its ID. An empty pipeline field means the main pipeline.

Codes of custom fields look like UF_CRM_1234567890 and are shown in the field settings in the CRM. Pass them with their values in the additional fields JSON of the Bitrix24 block.

That is fine. The title, name and comment are plain fields, not JSON, so the customer text can go in as is, with any characters and line breaks.

Open the result of the Bitrix24 block: on failure success is false and error_message holds the portal answer. For example, insufficient_scope means the webhook has no rights for that section. If the portal asks to slow down, the block waits and retries by itself.

Build your first scheme for free

Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.

Build it in the builder