# Intercom

![Intercom_logo.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5871914946317.png)
Intercom is a customer and client messaging platform. It provides businesses a way to chat with their customers directly on their own websites/platforms and helps build better customer relationships through personalized, messenger-based experiences across the customer journey.

Relyance AI provides two (2) options to connect with a tenant’s Intercom account.

1. [The first option uses an **Access** **Token** created in Intercom.](#h_01G1RZQC29D6G6XX981AMDZZ1F)
2. [The second option uses a **OAuth2 / App Token** created in the Relyance AI tenant.](#h_01G1S142SQ4KEGHWYRK9ZJY6BG)

#### Option 1 - Create an Access Token in Intercom

![Intercom-1.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872285431437.png)
![Intercom-2.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872356646541.png)
![Intercom-3.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872350202765.png)
---

![Intercom-5.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872465879309.png)

In order to integrate Intercom with Relyance AI using an Access Token we will first need create an Intercom Application with permissions.

**In Intercom:**

1. Login to your Intercom account.
2. Navigate to **Settings**.
3. Go to **Developers**> **Developer Hub**.

4. Click on **New App**.

5. Enter a name for the app and select **Internal integration**.

![Intercom-4.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872352632461.png)

6. Click on **Create App**.
7. Click on **Authentication** in the sidebar.
8. Click on **Edit** and then go to the **Permissions** section.
9. Select all Read Only Permissions.

10. Hover over the **Access Token** in the section above.

 i. If a warning shows up, then click on **regenerate the token** link in the tooltip message.

 ![Intercom-6.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872624338061.png) ii. Click on the **Regenerate token** button in the following screen. Go back to the
 **Authentication** tab.

 ![Intercom-7.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872664418189.png)

11. Copy the **Access Token** at the top to be used in Relyance.

![Intercom-8.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872662169485.png)

**In the Relyance AI application:**

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **Intercom** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **Custom**.
8. Paste the **Access Token** into its respective field.

![Intercom-9.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5872950902285.png)

9. Click **Save.**
10. At this point, you should see the following result on the Vendor Integrations page:

11. Congratulations, you are now connected to **Intercom**.

#### Option 2 - Create an Oauth2 / App Token link in Relyance AI

![Intercom-11.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5873365329549.png)
---

In order to integrate Intercom with Relyance AI using an Oauth2 / App Token link created in Relyance, you will need an account that has the correct permissions.

**In the Relyance AI application:**

1. Login to your Relyance account.
2. Navigate to the **Settings** Menu in the bottom left-hand side.
3. Select **Integrations**.
4. Click on the **Vendor Integration** tab.
5. Find the **Intercom** integration card and click it to open its connections.
6. Under **Authentication Method**, choose **0auth2 / App Token**.
8. Click **Save.**
9. This will prompt you to choose the account you would like to proceed with. Choose an account with appropriate permissions or a service account.
10. This will request permission access for Intercom.

11. Confirm access.
12. At this point, you should see the following result on the Vendor Integrations page:

![Intercom-10.png](https://assets.relyanceuat.xyz/images/docs/5872138329229/5873041196941.png)

13. Congratulations, you are now connected to **Intercom**.

    The **Authentication** step asks for:

    - **Access Token**: required; held as a secret.

<!-- failure-modes:begin (generated from the integration catalog; do not hand-edit) -->

## If the connection reports Connected but returns nothing

These are the ways this integration comes back empty without reporting an error. Generated from the integration catalog, so it tracks what the connection actually asks for.

1. **A feature you enabled returns nothing.** Some scopes belong to a feature rather than to the connection: **Data subject requests** needs `Read admins`, `Read and write users`. Turning the feature on after the connection exists does not widen the grant it already holds, so re-authenticate the connection.
2. **Authorised, then empty.** The connection carries an authorisation, not a password: it stops returning data if the account that granted it loses access, its own permissions narrow, or the grant is revoked at the vendor. None of that reports an error here -- the connection keeps its last status until the next scan.
3. **A credential rotated at the vendor is not picked up here.** **Access Token** is stored when you save the connection, so regenerating the value at the vendor breaks the next scan until it is re-pasted here. Recording the expiry on the connection means Relyance warns you before it lapses.

<!-- failure-modes:end -->

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

### OAuth (browser authorization)

The **OAuth (browser authorization)** method uses a browser authorization flow, so the connection is created in the Relyance app. Manage it in Terraform afterwards by importing it (`terraform import relyance_integration_connection.example intercom/<connection_id>`) or reading it with the `relyance_integration_connection` data source.

### Access token

```hcl
resource "relyance_integration_connection" "intercom_1" {
  vendor = "intercom"
  name   = "<your connection name>"

  auth = {
    method = "access-token"
    params = {
      data_storage_location = "us"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      ACCESS_TOKEN = var.intercom_access_token
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
