{% note tip "" %}
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
{% endnote %}
Scope:
crmWho can execute the method: user with read access permission to CRM entities
The method crm.duplicate.findbycomm returns the identifiers of leads, contacts, and companies that contain phone numbers or email addresses from a specified list. The search does not consider the phone extension.
{% include Note on required parameters %}
#|
|| Name
type | Description ||
|| type*
string | Type of communication. Possible values:
EMAIL— email addressPHONE— phone || || values*string[]| Array of emails or phone numbers.
Maximum number of values — 20 ||
|| entity_type
string | Type of object. Possible values:
LEAD— leadCONTACT— contactCOMPANY— company
If not specified — the search is performed across all three types || |#
If 20 or more duplicates are found for one object, the other types are not returned. For example, if entity_type is not specified and duplicates are expected across all three objects, but there are 20 or more duplicates in leads, contacts and companies will not be returned. If there are 20 or more duplicates in contacts, we will receive duplicates for leads and contacts, while the company will be absent from the selection.
{% include Note on examples %}
{% list tabs %}
-
cURL (Webhook)
curl -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"entity_type":"CONTACT","type":"PHONE","values":["8976543","11223355"]}' \ https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.duplicate.findbycomm -
cURL (OAuth)
curl -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d '{"auth":"**put_access_token_here**","entity_type":"CONTACT","type":"PHONE","values":["8976543","11223355"]}' \ https://**put_your_bitrix24_address**/rest/crm.duplicate.findbycomm -
JS (TS)
// This snippet is an ES module: top-level await requires type="module" or a bundler. // $b24 is an already-initialized SDK instance (see the SDK "Get started" guide). import { Text } from '@bitrix24/b24jssdk' import type { B24Frame } from '@bitrix24/b24jssdk' declare const $b24: B24Frame // Shape of the payload returned in result (match the "response handling" section of the page) type FindByCommResult = { LEAD?: number[] CONTACT?: number[] COMPANY?: number[] } try { const response = await $b24.actions.v2.call.make<FindByCommResult>({ method: 'crm.duplicate.findbycomm', params: { entity_type: 'CONTACT', type: 'PHONE', values: ['8976543', '11223355'], }, requestId: Text.getUuidRfc4122() }) // The payload is available only on a successful response if (!response.isSuccess) { console.error(response.getErrorMessages().join('; ')) } else { const result = response.getData()!.result console.info('Contacts with duplicate phone:', result.CONTACT) } } catch (error) { // Thrown on transport or SDK failures (AjaxError, SdkError, etc.) console.error(error) }
-
JS (UMD)
<!-- Load the SDK (UMD build); it is exposed as the global B24Js --> <script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script> <script> async function findDuplicatesByComm() { try { // Initialize the SDK inside a Bitrix24 frame const $b24 = await B24Js.initializeB24Frame() const response = await $b24.actions.v2.call.make({ method: 'crm.duplicate.findbycomm', params: { entity_type: 'CONTACT', type: 'PHONE', values: ['8976543', '11223355'], }, requestId: B24Js.Text.getUuidRfc4122() }) // The payload is available only on a successful response if (!response.isSuccess) { console.error(response.getErrorMessages().join('; ')) return } const result = response.getData().result console.info('Contacts with duplicate phone:', result.CONTACT) } catch (error) { // Thrown on transport or SDK failures (AjaxError, SdkError, etc.) console.error(error) } } document.addEventListener('DOMContentLoaded', findDuplicatesByComm) </script>
-
Python
from b24pysdk.errors import BitrixAPIError, BitrixSDKException try: bitrix_response = client.crm.duplicate.findbycomm( entity_type="CONTACT", type="PHONE", values=["8976543", "11223355"], ).response result = bitrix_response.result print(result) except BitrixAPIError as error: print( "Bitrix API Error", f"error: {error.error}", f"error_description: {error.error_description}", sep="\n", ) except BitrixSDKException as error: print(f"Bitrix SDK Error: {error.message}") except Exception as error: print(f"Unexpected error: {error}")
-
PHP
try { $response = $b24Service ->core ->call( 'crm.duplicate.findbycomm', [ 'entity_type' => 'CONTACT', 'type' => 'PHONE', 'values' => ['8976543', '11223355'], ] ); $result = $response ->getResponseData() ->getResult(); if ($result->error()) { error_log($result->error()); } else { echo 'Duplicate data: ' . print_r($result->data(), true); } } catch (Throwable $e) { error_log($e->getMessage()); echo 'Error finding duplicates by communication: ' . $e->getMessage(); }
-
BX24.js
BX24.callMethod( "crm.duplicate.findbycomm", { entity_type: "CONTACT", type: "PHONE", values: ["8976543", "11223355"] }, function(result) { if(result.error()) console.error(result.error()); else console.dir(result.data()); } );
-
PHP CRest
require_once('crest.php'); $result = CRest::call( 'crm.duplicate.findbycomm', [ 'entity_type' => 'CONTACT', 'type' => 'PHONE', 'values' => ['8976543', '11223355'] ] ); echo '<PRE>'; print_r($result); echo '</PRE>';
-
Go
// client and ctx are already created — see the Go SDK section res, err := client.Core().Call(ctx, "crm.duplicate.findbycomm", b24.Params{ "entity_type": "CONTACT", "type": "PHONE", "values": []string{"8976543", "11223355"}, }) if err != nil { return fmt.Errorf("crm.duplicate.findbycomm: %w", err) } // The method wraps the response in an object with the "CONTACT" key. raw, ok := b24.Unwrap(res.Result, "CONTACT") if !ok { return fmt.Errorf("no CONTACT key in the response") } fmt.Printf("%s\n", raw)
{% endlist %}
HTTP status: 200
{
"result": {
"CONTACT": [275, 2297]
},
"time": {
"start": 1750684060.672785,
"finish": 1750684060.724903,
"duration": 0.05211806297302246,
"processing": 0.018191099166870117,
"date_start": "2025-06-23T16:07:40+03:00",
"date_finish": "2025-06-23T16:07:40+03:00",
"operating_reset_at": 1750684660,
"operating": 0
}
}#|
|| Name
type | Description ||
|| LEAD
integer[] | Array of identifiers of found leads ||
|| CONTACT
integer[] | Array of identifiers of found contacts ||
|| COMPANY
integer[] | Array of identifiers of found companies ||
|| time
time | Information about the request execution time ||
|#
HTTP status: 400
{
"error": "Communication type is not defined",
"error_description": "Parameter 'type' is required."
}{% include notitle Error handling %}
#|
|| Code | Description | Value ||
|| 403 | Access denied | User does not have permission to read CRM entities ||
|| 400 | Communication type is not defined | Required parameter type is not specified ||
|| 400 | Communication type '{type}' is not supported in current context | An unsupported communication type was specified ||
|| 400 | Communication values is not defined | Required parameter values is not specified ||
|#
{% include System errors %}