> For the complete documentation index, see [llms.txt](https://documentation.proto.cx/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.proto.cx/docs/modules/ai-agents/publishing/bitrix24.md).

# Bitrix24

{% hint style="info" %}
Publish to Bitrix24 with the Enterprise plan.
{% endhint %}

{% hint style="warning" %}
Requires a Bitrix24 account.
{% endhint %}

Publishing to Bitrix24 lets your audience interact with the AI agent — and later a live agent — in a Bitrix24 thread. Bitrix24 is unique among channels in supporting both [live agent handoff](/docs/modules/ai-agents/workflows-and-actions/human-handoff.md) to Proto, **or** [external handoff](/docs/modules/ai-agents/workflows-and-actions/external-handoff.md) to another chat user within Bitrix24 itself.

In the agent's **Publish** tab, create a Bitrix24 channel or select an existing one to open its settings.

***

## Basic settings

| Setting                   | Description                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------- |
| **Name**                  | Internal name distinguishing this channel from other Bitrix24 instances.            |
| **Default chat language** | Set from the agent's [Agent settings](/docs/modules/ai-agents/manage-ai-agents.md). |
| **Icon**                  | The channel's avatar, seen by live agents in the [Inbox](/docs/modules/inbox.md).   |

Select **Save** to confirm edits.

***

## Connect Bitrix24

A **Bitrix24 address** is required from your account.

1. In Bitrix24, go to **Settings → My Bitrix24 → Bitrix24 Address → Create address/Use own domain**, and copy the address.
2. In Proto, paste the address and select **Verify**. A handler path and initial installation path are generated.
3. In Bitrix24, go to **Applications → Developer Resources → Common Use Cases → Other → Local Application**.
4. Select **Server** and paste in the handler path and initial installation path from Proto.
5. Select **Save** — an **Application ID** and **Application key** are generated.
6. Paste these into Proto's Bitrix24 fields and select **Save and Verify**.
7. Select **Register** to add the Bitrix24 AI chatbot.

{% hint style="warning" %}
**Verification failed / unable to enable error?** In Bitrix24, go to **Applications → Developer Resources → Integrations** and confirm the Local Application was created. Select **REINSTALL** and verify again.
{% endhint %}

***

## Open Channel setup

If you have an existing Open Channel in Bitrix24 Live Chat, add the Local Application chatbot as the first support tier before transferring to a live agent.

1. Go to your **Open Channel → CONFIGURE → Chat Bots** tab.
2. Toggle on **Assign chat bot when a client enquiry is received**.
3. Select the chat bot created in your Local Application.
4. Set **Activate chat bot** to **Each time a client starts conversation**.
5. Set **Transfer conversation from bot to a live agent after** to your preferred period.
6. Set **Disconnect chat bot** to **after transferring the conversation to an agent**.
7. Select **Save**.

{% hint style="info" %}
In **Auto Actions**, if "Use CRM form to ask for contact information" is enabled, set **Show form** to **Wait for customer's first message**.
{% endhint %}

***

## Using Bitrix24

After setup, test the AI agent via the **Chat public link** or the **Open Channel** in your Bitrix24 widget.

***

## Identify a person in Bitrix24 Live Chat

To skip the contact form for signed-in audience members, embed this script on the page hosting the [Bitrix24 website widget](https://helpdesk.bitrix24.com/open/8772927/):

```
<script type="text/javascript">
window.addEventListener('onBitrixLiveChat', function(event) {
  var widget = event.detail.widget;
  widget.setUserRegisterData({
    'hash': '12b42ebcec7e3c26a313272c26efddbd',
    'name': 'John',
    'lastName': 'Smith',
    'avatar': 'http://files.smith.com/images/avatar-john.jpg',
    'email': 'john@smith.com',
    'www': 'https://bitrix24.com',
    'gender': 'M',
    'position': 'Loyal Customer'
  });
});
</script>
```

This identifies an existing user in your Bitrix24 organisation. To match a person in your Bitrix24 CRM Contacts, apply their email address to the `position` field.

***

## Related

{% content-ref url="/pages/EBzV3f92cqcYL1yuFMPL" %}
[External handoff](/docs/modules/ai-agents/workflows-and-actions/external-handoff.md)
{% endcontent-ref %}

{% content-ref url="/pages/Q8vjcCZyYoe2O9BUhiwc" %}
[Human handoff](/docs/modules/ai-agents/workflows-and-actions/human-handoff.md)
{% endcontent-ref %}
