> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/integrateandcode/app-integrations/intercom.md).

# Intercom

### Channel

From your bot page in [app.chatlayer.ai](http://app.chatlayer.ai/), go to the Channels menu and click "Add Channel" and select Intercom.&#x20;

![](/files/ZEdQqzUnghfWktB69w41)

Click "Next" and then "Connect new account"​

![](/files/E6FU220JWQvTRyHmBPJe)

You will see a pop-up where you can click "Authorize access" from Chatlayer to your Intercom account:

![](/files/7tHb6zdugnNRQoZL4UZS)

After clicking "Authorize Access" your account will appear on Chatlayer:\
​

![](/files/3WaFXnNk2fP9F5VRRAMW)

After clicking "Next", you will reach 'Step 2: Configure Subscription'. There you'll have the following fields:

* Subscription Webhook URL: this will be automatically linked to your Intercom account. If you have any questions about how to deploy Intercom's widget, please refer to their [documentation](https://developers.intercom.com/installing-intercom/docs).
* Bot teams: you need to add all of the team IDs that should expect the bot to interact with. You can find the team IDs in the URL for each team. In the example below 000000 is the team id.\ <mark style="background-color:yellow;"><https://app.intercom.com/a/inbox/xxxx0xx0/inbox/team/0000000/conversation/000000000000000></mark>
* Bot Agent: messages sent by the bot will be seen as sent from the selected agent from the dropdown menu.

![](/files/tB37ePhhP1ARSGoxQ5Bm)

### Handover to an agent

After you have connected your Intercom channel, you can set up the handover from the bot to a human agent. At that point in the bot flow, you can add an Action block and click on 'Send to offload provider'. The 'Offload' configuration will appear at the top of your editor.

![](/files/KFjTJgQU3WN5VEuWIBrZ)

{% hint style="warning" %}
Make sure that you pick a team that shouldn't have the chatbot replying (a team that you haven't informed in the channel configuration)
{% endhint %}

![](/files/N6s60BtHqrp8iPpQ1rif)

### Close conversation action

If the user issues have already been solved by the bot, you can close the conversation to keep your customer support tool uncluttered. You can add the "close conversation action" by choosing the Intercom integration on the Apps menu:

![](/files/2sUJLZV9VGfPtlaw3Ccq)

And configuring it to close the conversation after the user reaches a certain point in the conversation, for example, after a satisfaction survey. The configuration can be done by retrieving the conversation ID from the internal variable `intercom.conversationId` and in the Reason field, you can write a message to the user stating that the conversation was closed and why.

![](/files/OOpY9uD9DdRknZIRVrbe)

Now you're all set for your automated, meaningful conversations through Chatlayer and the Intercom widget.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.chatlayer.ai/integrateandcode/app-integrations/intercom.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
