# Kommo

Connect Kommo (amoCRM) so the assistant recognises callers by phone, creates contacts and leads, and logs every call as a note

> Full REST + WebSocket API reference: https://api.happ.tools/reference

Kommo (amoCRM) connects with a long-lived token of a private integration that you create in your account. Once it's linked, the assistant greets known customers by name with their latest lead in hand, creates a contact and a lead when someone leaves a request, and writes the outcome of every call to the customer's record.

## What the assistant can do [#what-the-assistant-can-do]

* **Recognise the caller** — at the start of a call it looks the phone number up in Kommo and gets the contact's name, email, company and their latest lead (name, stage, budget).
* **Create a lead** — finds the contact by phone or creates a new one, then creates a lead in the pipeline and stage you choose. The request, delivery address, products and the ad that brought the customer go into the lead as a note.
* **Log calls** — after each call it adds a note to the customer's open lead (or to the contact): direction, duration, outcome, summary, the recording link and, if you want, the full transcript.

## Before you start [#before-you-start]

* **Kommo administrator** — only an administrator can create the token.
* **HAPP workspace** with at least one assistant.
* **Kommo enabled for your workspace** — the integration is switched on per company. Ask HAPP support to enable it.

## Create the token [#create-the-token]

1. In Kommo open **Settings > Integrations** and click **Create integration**.
2. Choose a private integration, name it `HAPP` and save. Redirect URL and the revoke webhook can stay empty.
3. On the **Keys and scopes** tab click **Generate long-lived token**, pick the expiry (up to 5 years) and copy the token — Kommo shows it only once.

## Connect [#connect]

1. In HAPP open **Integrations** and find Kommo under **Add a CRM**.
2. Click **Connect**, enter your account address (`acme`, `acme.kommo.com` or the `amocrm.ru` address) and paste the token.
3. Kommo appears under **My integrations** with your account name.

## Settings [#settings]

Open the card's gear icon on the assistant's **Integrations** tab.

* **Search** — recognise the caller by phone.
* **Create** — leads. Pick the **pipeline**, **stage** and **owner**; without them the lead goes to your main pipeline, first stage. **Incoming leads**, **Closed – won** and **Closed – lost** are not offered as a stage.
* **Call notes** — a note after every call. **Full transcript** adds the conversation text.

## Limits [#limits]

* Kommo stores phone numbers as typed; the assistant matches on the last 9 digits, so `050 111 22 33` and `+380501112233` are the same customer.
* A number that isn't in Kommo gets no call note — there is no record to attach it to.
* The token stops working on the expiry date you picked — generate a new one before then.

## Troubleshooting [#troubleshooting]

| Problem                                                        | Cause                                                  | Fix                                                          |
| -------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------ |
| "Enter the Kommo account address, e.g. acme or acme.kommo.com" | The address is not a Kommo or amoCRM account           | Copy the address from your browser while in Kommo.           |
| "Kommo account not found"                                      | Typo in the address                                    | Check the account address.                                   |
| "Kommo: the token is invalid or expired"                       | The token expired or the integration was deleted       | Generate a new long-lived token and click **Connect** again. |
| "Kommo: the account is not paid"                               | The subscription ended — Kommo closes the API          | Renew the subscription.                                      |
| "Kommo: no access"                                             | The token's user lost rights or the account is blocked | Generate the token as an administrator.                      |

## Disconnect [#disconnect]

Disconnect the card in HAPP and delete the private integration in **Settings > Integrations**. Contacts, leads and notes already in Kommo stay.

## Next [#next]

* [CRM](/docs/integrations/crm) — all CRM integrations
* [Tools](/docs/agents/tools) — what the assistant calls during conversations
