---
title: "VoIP events"
method: POST
path: "/voip/integration"
tags: ["VoIP Integration"]
---

# VoIP events

`POST /voip/integration`

#### Enable integration
To use the api and activate access to the settings in the user interface, you need to activate the integration by sending the "Enable integration" request. After a successful connection, access to the section with routing settings will be opened in the chain user interface.

#### Disable integration
To disable the integration, you can use the "Disable integration" method. After the integration is disabled, access to the user interface settings section is closed, the requests "Call notification" and "Call information saving" are not processed.

#### Call notification
To display notifications about an incoming call, the "Call notification" method is used, the call type ("incoming", "outgoing", "internal") is specified in the parameters, but currently notifications are displayed only for the "incoming" value. Notifications are displayed for users defined based on routing settings. When specifying the "user" and "diversion" parameters at the same time, "user" is the priority when searching for routes.

#### Saving call information
The information about the call is automatically saved to the chain history and to the history of chain locations in accordance with the call routing settings.

## Headers

- `Accept` string, required
- `Content-Type` string, required
- `Authorization` string, required

## Request body

- union
  - VoipIntegrationEnableRequestDataTypes — Connect integration
    - `command` string, required — Operation type: 'setup'
    - `type` string, required — Operation type, in this case 'enable'
    - `crm_token` string, required — CRM-token from the VoIP Integration in the client's chain section
  - VoipIntegrationDisableRequestDataTypes — Disable Integration
    - `command` string, required — Operation type: 'setup'
    - `type` string, required — Operation type, in this case 'disable'
    - `crm_token` string, required — CRM-token from the VoIP Integration in the client's chain section
  - VoipIntegrationHistoryRequestDataTypes — Save Call Information
    - `command` string, required — Operation type: 'history'
    - `type` string, required — Operation type ("incoming", "outgoing", "internal")
    - `crm_token` string, required — CRM-token from the VoIP Integration in the client's chain section
    - `phone` string, required — Caller number
    - `user` string — SIP subscriber ID
    - `diversion` string, required — The number through which the call came
    - `duration` number — Call duration (in seconds)
    - `link` string — Call recording link
    - `call_id` string — Call ID in voip system
    - `status` string — Call status 'success'|'missed'
    - `date` string, date-time — Date and time of the call (ISO8601)
  - VoipIntegrationNotificationRequestDataTypes — Call Notification
    - `command` string, required — Operation type: 'event'
    - `type` string, required — Operation type, in this case "incoming"
    - `crm_token` string, required — CRM-token from the VoIP Integration in the client's chain section
    - `phone` string, required — Caller number
    - `user` string — SIP number
    - `diversion` string, required — The number through which the call came

## Response `202`

Accepted

- VoipIntegrationResponseDataTypes — Connect Integration
  - `success` boolean — Success status (true)
  - `data` string — Contains null
  - `meta` object — Metadata (contain an "Accepted" message)
    - `message` string

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.dev/alteg/apis/developer-tools.md) · [All operations](https://skmtc.dev/alteg/apis/developer-tools/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/alteg/developer-tools/revisions/c89b6494ffd2/schema)
