Configuring Lead Submission from a 1C-Bitrix Site to Bitrix24 CRM
A contact form is filled out on the site — and the lead appears nowhere. A manager learns about the submission from a corporate email thirty minutes later and enters it into CRM manually. By then the customer has already called a competitor. Correct configuration delivers the lead to Bitrix24 immediately and automatically.
Submission Methods
Option 1. The Bitrix24 Connector module — installed from the marketplace, links form infoblocks to CRM without code. Suitable for standard web forms (bitrix:main.feedback, bitrix:form.result.new).
Option 2. Direct REST API — a handler in the form component calls crm.lead.add via \Bitrix\Main\Web\HttpClient. Suitable for non-standard forms, custom components, and React/Vue forms embedded in Bitrix.
REST API Configuration
Generate an incoming webhook in Bitrix24: Applications → Webhooks → Incoming webhook. Select crm permissions (read/write). Copy the URL in the format https://your-domain.bitrix24.ru/rest/1/token/.
In the form handler on the site:
use Bitrix\Main\Web\HttpClient;
$http = new HttpClient();
$http->setHeader('Content-Type', 'application/json');
$leadData = [
'TITLE' => 'Web inquiry: ' . $formFields['NAME'],
'NAME' => $formFields['NAME'],
'PHONE' => [['VALUE' => $formFields['PHONE'], 'VALUE_TYPE' => 'WORK']],
'EMAIL' => [['VALUE' => $formFields['EMAIL'], 'VALUE_TYPE' => 'WORK']],
'COMMENTS' => $formFields['MESSAGE'],
'SOURCE_ID' => 'WEB',
'SOURCE_DESCRIPTION' => 'Form: ' . $formName . ' | URL: ' . $pageUrl,
];
$response = $http->post(
'https://your-domain.bitrix24.ru/rest/1/token/crm.lead.add.json',
json_encode(['fields' => $leadData, 'params' => ['REGISTER_SONET_EVENT' => 'Y']])
);
Required Lead Fields
-
TITLE— lead name (displayed in the CRM list). -
SOURCE_ID— source:WEB,CALL,EMAIL, etc. from thecrm.status.listdirectory withENTITY_ID = SOURCE. -
PHONE/EMAIL— arrays with a value type.
The SOURCE_DESCRIPTION field is useful for analytics — store the page URL, form name, and UTM parameters from $_COOKIE or $_GET.
UTM Parameters and Traffic Source
Pass UTM data to the lead for attribution:
$utmFields = [];
foreach (['utm_source','utm_medium','utm_campaign','utm_term','utm_content'] as $utm) {
if (!empty($_COOKIE[$utm])) {
$utmFields['UTM_' . strtoupper(substr($utm, 4))] = $_COOKIE[$utm];
}
}
$leadData = array_merge($leadData, $utmFields);
UTM fields (UTM_SOURCE, UTM_MEDIUM, etc.) are standard lead fields in Bitrix24.
Assigning a Responsible Manager
By default, the lead is assigned to the user who created the webhook. To distribute leads among managers, use ASSIGNED_BY_ID — the Bitrix24 user ID. Build the assignment logic based on form data: selected city, service type, working hours.
Duplicate Control
Before creating a lead, check for existing contacts by phone via crm.duplicate.findByComm:
$dupes = $http->post($webhookUrl . 'crm.duplicate.findByComm.json', json_encode([
'type' => 'PHONE',
'values' => [$formFields['PHONE']],
]));
If a contact is found — create a deal or activity on the existing contact instead of a new lead. This prevents the CRM from being cluttered with duplicate leads from returning customers.
Configuring lead submission for a standard form — 4–6 hours. Custom logic with UTM tracking, deduplication, and manager assignment — 1–2 working days.







