# Calls in CRM

Registration of inbound and outbound external calls in Bitrix24 CRM, displaying the call card to the operator, finishing with a status and duration, attaching a text transcription of the conversation.

Bitrix24 API: `telephony.externalcall.*`, `telephony.call.attachTranscription`
Scope: `telephony`

## Operations

- [Register a call](./crm/register.md) — `POST /v1/calls/register`
- [Finish a call](./crm/finish.md) — `POST /v1/calls/:callId/finish`
- [Show the card](./crm/show.md) — `POST /v1/calls/:callId/show`
- [Hide the card](./crm/hide.md) — `POST /v1/calls/:callId/hide`
- [Attach a transcription](./crm/transcription.md) — `POST /v1/calls/:callId/transcription`

## Typical scenario

1. An inbound call arrives at the external PBX → `POST /v1/calls/register` with `crmCreate: true` creates a lead if the number is not found in CRM. The response contains `CALL_ID` and `CRM_ENTITY_ID`.
2. The card is shown to the operator: `POST /v1/calls/:callId/show`.
3. The call is finished: `POST /v1/calls/:callId/finish` with a duration and a result code.
4. After speech recognition, a transcription is attached: `POST /v1/calls/:callId/transcription` with a list of dialogue lines.

## See also

- [Telephony — overview](../telephony.md)
- [Lines](./lines.md) — lines for the `lineNumber` parameter in register
- [Outbound calls](./outbound.md) — to initiate calls via the API
