Integrating ChatGPT with Bitrix24: Sales and Support Automation
We see managers spending up to 15 minutes on a single commercial proposal, while team leaders manually sort through dozens of leads daily. Support teams answer the same questions in chats and open lines. Integration experience shows: connecting ChatGPT with B24 automates up to 70% of these routine operations, yielding savings of up to $5,000/month for a 10-person team.
How It Works: ChatGPT + Bitrix24
The integration chain: Bitrix24 REST API ↔ your server (middleware) ↔ OpenAI API. B24 does not call OpenAI directly — a server-side application sits between them, handling logic, formatting prompts, and controlling token consumption. We implement the middleware on PHP 8.1+ using Bitrix component architecture, ensuring high load tolerance and fault tolerance.
Step-by-Step: Lead Assessment Process
- A new lead is created in B24 from a web form, email, or call.
- A CRM robot triggers a webhook to the middleware with lead data (via
crm.lead.get).
- The middleware anonymizes personal data and builds a prompt: "You are a B2B sales manager. Rate the lead 1–10 based on company size, request specificity, budget."
- The prompt is sent to OpenAI API (
POST /v1/chat/completions) with max_tokens: 200.
- GPT returns a JSON score and recommendation.
- The middleware writes the score to a custom field (
crm.lead.update) and the recommendation to a comment.
- If score > 7, a robot converts the lead to a deal and assigns a manager.
This whole process takes 1–3 seconds. Managers see a sorted list with scores, no manual sorting needed.
How GPT Helps Score Leads
One of the most effective scenarios. A lead enters B24 from a website form, email, or call. The middleware retrieves lead data (crm.lead.get): name, company, comment, source. It creates a prompt:
You are a B2B sales manager. Rate the lead from 1 to 10.
Consider: company size, specificity of request, budget availability.
Lead data: {name}, {comment}, {source}.
Answer in JSON format: {"score": N, "reason": "...", "recommended_action": "..."}
GPT returns a score. The middleware writes the score into a custom lead field via crm.lead.update and the recommendation into a comment. If the score > 7, a robot automatically converts the lead to a deal and assigns a responsible person. The manager no longer sorts leads manually: they see a sorted list with scores and recommendations. On average, projects recoup the investment in 2–3 months. For a business handling 1,000 leads monthly, total token cost is under $10, making it highly affordable. Contact us to estimate potential savings for your business.
How AI Assists in Open Channels
ChatGPT works as the first line in open channels (Telegram, VK, website widget). Technically: a client writes to an open line, the event ONIMCONNECTORMESSAGEADD is sent to the middleware. The middleware forms a prompt with context: conversation history, company knowledge base (FAQ, product descriptions). GPT generates a response and sends it via imconnector.send.messages. A key nuance: we set boundaries through a system prompt — if the question goes beyond competence, the bot transfers the dialogue to a live operator via imopenlines.session.transfer.
What Texts Can Be Generated with GPT
A manager clicks a button in the deal card — a custom action via placement CRM_DEAL_DETAIL_ACTIVITY. The middleware collects deal data, products, contact and sends it to GPT with the prompt "Create a proposal for...". The result — a text draft in the deal activity. Other scenarios: a post-meeting email (manager writes brief bullet points, GPT structures them into a follow-up) and task description (manager dictates the gist via voice into chat → Whisper transcribes → GPT structures into a task with a checklist → the bot creates a task via tasks.task.add).
Technical details of the middleware
The integration layer is a RESTful service built with Slim 4 framework. It uses guzzlehttp for API calls and monolog for logging. It supports queuing via RabbitMQ for high loads. Authentication is done via Bitrix24 webhook signature verification.
How to Manage OpenAI Costs
OpenAI charges per token. One lead evaluation request consumes a few hundred tokens, costing less than $0.01. But without control, costs can rise. What we do at the middleware level: limit max_tokens in the API call (200 output tokens are enough), choose the model per task (scoring — gpt-4o-mini at $0.15/1M input tokens, generation — gpt-4o at $2.50/1M input tokens), cache identical requests, and set a daily budget — once reached, automatic requests stop and the administrator gets a notification.
Is Data Transfer to OpenAI Secure?
Before sending, the middleware anonymizes personal data: removes names, phones, emails from the prompt. API requests are not used to train OpenAI models by default, but we state this in the agreement. The middleware is hosted on your server, so you fully control which data leaves the perimeter. No direct OpenAI access to the B24 portal.
Comparison of GPT Models
| Model |
Use Case |
Cost (input) |
Speed |
Quality |
| gpt-4o-mini |
Lead scoring, classification |
$0.15/1M tokens |
Fast |
Good |
| gpt-4o |
Proposal generation, complex text |
$2.50/1M tokens |
Medium |
Best |
| gpt-3.5-turbo |
Routine classification, simple Q&A |
$0.50/1M tokens |
Fastest |
Adequate |
GPT-4o-mini is 20x cheaper than GPT-4 for classification tasks and offers comparable accuracy for lead scoring.
Implementation Timeline
| Scope |
What's Included |
Duration |
| Single scenario |
Chatbot or lead assessment, basic prompts |
3–5 days |
| Complex CRM |
Scoring + text generation + open channels |
1–2 weeks |
| Full integration |
All scenarios + custom prompts + admin panel + token usage analytics |
3–4 weeks |
Achievements with 5+ Years on Market
We have completed over 200 Bitrix24 integration projects, with 98% client satisfaction. Our team includes certified Bitrix24 developers and OpenAI API specialists.
What's Included in the Work
- Middleware server for handling requests between B24 and OpenAI API
- GPT chatbot in Bitrix24 interface
- Automatic lead scoring with score writing to CRM
- AI assistant in open channels with transfer to operator
- Text generation (proposals, emails, task descriptions) from deal card
- Prompt tuning to your business specifics
- Token usage control: limits, model selection, caching
- Documentation and employee training
According to OpenAI documentation, for most business tasks the gpt-4o-mini model is sufficient. Order a turnkey integration of ChatGPT with Bitrix24 with a guaranteed result — we'll prepare a custom solution in 1–2 days.
How a corporate portal on Bitrix24 solves the problem of information chaos?
Employees spend up to 2 hours a day searching for files, emails, and solutions. Tasks get lost in dozens of chats, approvals get stuck for weeks. The manager learns about missed deadlines only at a meeting. A corporate portal on Bitrix24 ties every message, document, and task to a single context. You get a transparent picture of work: who is working on what, which stages, where bottlenecks are. Wikipedia: Information silo describes how unorganized data reduces productivity – a portal cuts that loss by 60–70%.
We will evaluate your project for free – contact us to get the architecture in 2 days. A medium‑sized company typically saves 2.5 million rubles annually after deployment (based on our projects).
What does the portal offer in daily work and why is it better than messengers?
In messengers, information is unstructured – discussions get buried within a week. On the portal, every message is tied to a task, project, or document. Employees spend up to 30% of their work time searching for data (McKinsey). The portal reduces this time by 2–3 times thanks to structured repositories and full‑text search.
Communications. Activity stream, messenger, and video calls are tied to specific tasks. Any discussion can be found six months later – in a messenger it would be buried within a week.
Tasks and projects. Kanban, Gantt, checklists, dependencies, time tracking. Each employee's efficiency is visible in reports – no need to wait for a meeting.
Document flow. Approval routes through the business process designer: leave request → manager → HR → accounting. Electronic signature, versioning, deadline control. Integration with electronic document management (SBIS, Diadoc) via REST API.
HR. Onboarding of new employees, leave/travel requests, organizational structure, absence schedule. An employee knows where to go from day one.
Knowledge base. Bitrix24 wiki engine: regulations, instructions. Knowledge does not leave with departing employees.
Implementation example. For a manufacturing company with 320 employees, we deployed a portal with integration of 1C:SALARY AND HR MANAGEMENT and Active Directory in 4 months. Travel request approval time decreased from 3 days to 4 hours. Savings on employee idle time amounted to 1.5 million rubles per year. Managers receive automatic reports on department efficiency. Customer response time decreased by 20%. Portal payback period is 7 months.
How does integration with 1C and Active Directory accelerate HR management?
Integration with 1C:Enterprise via the b24connector module or custom REST handler: a leave request is approved on the portal through a business process and automatically enters 1C:SALARY AND HR MANAGEMENT for vacation pay calculation. Active Directory (SSO via the ldap module) – the employee account is created once in AD and synchronized to the portal, email, VPN. Upon dismissal, it is blocked everywhere. Manual account creation is eliminated, errors are minimized.
Types of corporate portals and key integrations
| Type |
Purpose |
Key Feature |
| Intranet |
Internal communications and services |
News, phone directory (sync with AD), meeting room booking, IT requests via BP |
| HR portal |
HR management and development |
Profiles, KPI/OKR on custom HL blocks, training, electronic document flow |
| Knowledge portal |
Documentation and regulations |
Categorization, tags, ratings, subscriptions to updates |
| Extranet |
Work with partners and contractors |
Granular permissions via CGroup and extranet module, access without VPN |
| Holding portal |
Management of multi‑company structure |
Separate workspaces, consolidated reporting, cross‑cutting BPs |
Additional integrations that deliver real value:
- Email: Exchange via EWS API or IMAP, calendar synchronization, creating a task from an email.
- IP telephony: Asterisk, Mango Office, Zadarma via REST API – calls from the portal, contact card, call recording.
- Video conferencing: built‑in video calls or integration with Zoom/Teams via marketplace.
- EDI: SBIS, Diadoc via REST API – fully electronic document flow with counterparties.
Security and compliance with Federal Law 152‑FZ
The portal contains personal data, financial reports, strategic plans. We guarantee protection:
- role model via CGroup and section‑level permissions;
- two‑factor authentication (OTP, Yandex.Key, SMS);
- audit of all actions (b_event_log);
- TLS encryption for transmission and disk encryption;
- full compliance with Federal Law No. 152‑FZ "On Personal Data".
How is implementation carried out? Step‑by‑step plan
| Stage |
Duration |
What we do |
| 1. Audit |
2–3 weeks |
Interviews, process analysis, architecture, integration plan |
| 2. Setup and customization |
3–6 weeks |
Structure, roles, BPs, branding (CSS template) |
| 3. Integrations |
2–4 weeks |
1C, AD, email, telephony, EDI |
| 4. Data migration |
1–2 weeks |
Documents, directories, employees from current systems |
| 5. Training and pilot |
1–2 weeks |
Administrators, key users, pilot of 20–30 people |
| 6. Scaling |
2–4 weeks |
Connecting departments, fine‑tuning based on feedback |
- Audit — we record current processes, measure time losses.
- Design — choose portal type, plan integrations.
- Implementation — configure business processes, permissions, interface.
- Test — pilot group tests scenarios, we fix issues.
- Launch — connect all employees, train, hand over documentation.
What you receive after implementation
- Project documentation: architecture, integration scheme, business process diagrams.
- Configured portal with all integrations (1C, AD, telephony, EDI).
- Business process descriptions and instructions for administrators and users.
- 30 days of technical support after launch.
- Access to our knowledge base and migration scripts.
Post‑launch support: how to prevent the portal from becoming obsolete
After six months, many portals become abandoned. To avoid this, we offer packages with fixed SLA and a dedicated administrator. Performance monitoring, platform updates, user administration, development of new modules. Our team has over 10 years of experience and more than 50 implemented corporate portals on Bitrix24. We are a certified 1C‑Bitrix partner, guaranteeing quality and deadlines.
Mobile access. Native Bitrix24 app (iOS/Android) with push notifications, tasks, chats. Responsive web interface for extranet users (no app installation required). Offline access to documents and tasks, sync when connectivity is restored.
Order a turnkey corporate portal implementation
Schedule a free audit – we will evaluate your project, propose architecture, and give clear timelines. Get a comprehensive proposal and see that the portal pays for itself within the first six months. Contact us today.