# Bindings

Linking a single log entry to multiple CRM entities. Besides the parent entity (specified at creation), an entry can be additionally bound to other CRM records — it will appear in their timelines too.

Bitrix24 API: `crm.timeline.bindings.*`
Scope: `crm`

## Operations

- [Bind an entry](./bindings/bind.md) — `POST /v1/timeline-logs/:id/bind`
- [Unbind](./bindings/unbind.md) — `POST /v1/timeline-logs/:id/unbind`
- [List bindings](./bindings/list.md) — `GET /v1/timeline-logs/:id/bindings`

## When to use

- An AI agent processed a client's deal — the event should appear in the deal's timeline, the contact's timeline, and the company's timeline. Create the entry for the deal, bind it to the contact and the company.
- A payment on an invoice went through — mark it in all related cards at once.
- A document signed by several parties — a log entry in the timeline of every involved contact and company.

## Typical scenario

1. Create a log entry for the main entity: [`POST /v1/timeline-logs`](/docs/timeline-logs/logs/create) with `entityTypeId: 2, entityId: <dealId>`.
2. Bind it to the contact: [`POST /v1/timeline-logs/:id/bind`](./bindings/bind.md) with `entityTypeId: 3, entityId: <contactId>`.
3. Bind it to the company: another `POST /:id/bind` with `entityTypeId: 4`.
4. Check the resulting list: [`GET /v1/timeline-logs/:id/bindings`](./bindings/list.md) — there should be three bindings.

## Supported entity types

| `entityTypeId` | string `ENTITY_TYPE` |
|:---:|---|
| 1 | `lead` |
| 2 | `deal` |
| 3 | `contact` |
| 4 | `company` |
| 7 | `quote` |
| 14 | `order` |
| 31 | `smart_invoice` |
| ≥ 128 | `dynamic_<entityTypeId>` (arbitrary smart processes) |

In bind/unbind you can pass either `entityTypeId` (numeric) or `entityType` (string) directly — Vibecode substitutes the right value into the B24 call itself. In the `bindings.list` response both fields are returned for the client's convenience.

## See also

- [CRM Timeline](/docs/timeline-logs) — section overview
- [Log entries](/docs/timeline-logs/logs) — creating log entries before binding
- [Smart processes](/docs/entities/smart-processes) — for custom CRM types with `entityTypeId ≥ 128`
