---
updatedAt: 2026-01-26T15:36:22.000Z
agentTools:
  projectIndex: https://developers.kommo.com/llms.txt
---

# Caller ID

As people recognize names more than numbers, it’s a good practice for your integration to retrieve the caller identity which can be implemented in two different ways:

* Adding the notification about the call using the <Anchor label="Call event" target="_blank" href="https://developers.kommo.com/reference/add-call-notifications">Call event</Anchor> method. This method performs a search for the caller ID and creates a notification connected to the card with this phone number if it exists
* Using the <Anchor label="Get contact list" target="_blank" href="https://developers.kommo.com/reference/contacts-list#find-contact-by-a-phone-number">Get contact list</Anchor> request filtering by phone number with `query` parameter:

```curl
curl --request GET \
     --url 'https://subdomain.kommo.com/api/v4/contacts?query=$phone_number' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer XXXX'
```

Each way uses a different algorithm to perform the search, and each one considers a different number of digits from the phone number as an input to the search process. The **Call event** uses the *last 8 digits* and searches first for a contact then for a company. It may return a lead according to the case. While the **Get contacts by phone** method uses the *last 7 digits* and searches first for a company then for a contact. It also may return a lead according to different considerations.

```javascript JavaScript
const FALLBACK_FN = () => undefined;
const PHONE_CUSTOM_FIELD_CODE = "PHONE";

const searchContactByPhone = async (phone, callbacks = {}) => {
  const { onSuccess = FALLBACK_FN, onError = FALLBACK_FN } = callbacks;

  if (!phone) {
    return;
  }

  try {
    const contactsData = await $.ajax(`/api/v4/contacts?query=${phone}`, {
      method: "GET",
    });

    onSuccess(contactsData);

    return contactsData._embedded.contacts;
  } catch (error) {
    onError(error);
  }
};

```