---
title: "Linking entities"
method: POST
path: "/api/v4/{entity}/{entity_id}/link"
---

# Linking entities

`POST /api/v4/{entity}/{entity_id}/link`

This method allows linking entities to a lead, contact or company.

## Path parameters

- `entity` 'leads' | 'contacts' | 'companies', required
- `entity_id` integer, required

## Headers

- `Content-Type` string

## Request body

- object
  - `RAW_BODY` object[]
    - `to_entity_id` integer, required — Linked entity ID
    - `to_entity_type` 'leads' | 'contacts' | 'companies' | 'catalog_elements', required — Linked entity type (`leads`, `contacts`, `companies`, `catalog_elements`)
    - `metadata` object — Linked entity metadata
      - `catalog_id` integer — List ID
      - `quantity` integer — Quantity of the linked list elements
      - `is_main` boolean — Defines whether the contact is main for the entity
      - `updated_by` integer — The ID of the user performing the linking

## Response `200`

200

## Other responses

- `400` — 400
- `401` — 401
- `403` — 403

---

[API](https://skmtc.net/kommo/apis/kommo-api-references.md) · [All operations](https://skmtc.net/kommo/apis/kommo-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kommo/kommo-api-references/versions/f17af4d23c7c/schema)
