intercom-client
Version:
Official Node bindings to the Intercom API
3,736 lines (2,620 loc) • 348 kB
Markdown
# Reference
## Admins
<details><summary><code>client.admins.<a href="/src/api/resources/admins/client/Client.ts">identify</a>() -> Intercom.AdminWithApp | undefined</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can view the currently authorised admin along with the embedded app object (a "workspace" in legacy terminology).
> 🚧 Single Sign On
>
> If you are building a custom "Log in with Intercom" flow for your site, and you call the `/me` endpoint to identify the logged-in user, you should not accept any sign-ins from users with unverified email addresses as it poses a potential impersonation security risk.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.admins.identify();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `AdminsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.admins.<a href="/src/api/resources/admins/client/Client.ts">away</a>({ ...params }) -> Intercom.Admin | undefined</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can set an Admin as away for the Inbox.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.admins.away({
admin_id: 1,
away_mode_enabled: true,
away_mode_reassign: true,
away_status_reason_id: 12345
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ConfigureAwayAdminRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AdminsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.admins.<a href="/src/api/resources/admins/client/Client.ts">listAllActivityLogs</a>({ ...params }) -> Intercom.ActivityLogList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can get a log of activities by all admins in an app.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.admins.listAllActivityLogs({
created_at_after: "1677253093",
created_at_before: "1677861493"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListAllActivityLogsRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AdminsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.admins.<a href="/src/api/resources/admins/client/Client.ts">list</a>() -> Intercom.AdminList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of admins for a given workspace.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.admins.list();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `AdminsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.admins.<a href="/src/api/resources/admins/client/Client.ts">find</a>({ ...params }) -> Intercom.Admin | undefined</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can retrieve the details of a single admin.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.admins.find({
admin_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.FindAdminRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AdminsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## AI Content
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">listContentImportSources</a>() -> Intercom.ContentImportSourcesList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can retrieve a list of all content import sources for a workspace.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.listContentImportSources();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">createContentImportSource</a>({ ...params }) -> Intercom.ContentImportSource</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can create a new content import source by sending a POST request to this endpoint.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.createContentImportSource({
url: "https://www.example.com"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateContentImportSourceRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">getContentImportSource</a>({ ...params }) -> Intercom.ContentImportSource</code></summary>
<dl>
<dd>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.getContentImportSource({
source_id: "source_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.GetContentImportSourceRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">updateContentImportSource</a>({ ...params }) -> Intercom.ContentImportSource</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can update an existing content import source.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.updateContentImportSource({
source_id: "source_id",
sync_behavior: "api",
url: "https://www.example.com"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.UpdateContentImportSourceRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">deleteContentImportSource</a>({ ...params }) -> void</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can delete a content import source by making a DELETE request this endpoint. This will also delete all external pages that were imported from this source.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.deleteContentImportSource({
source_id: "source_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DeleteContentImportSourceRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">listExternalPages</a>() -> Intercom.ExternalPagesList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can retrieve a list of all external pages for a workspace.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.listExternalPages();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">createExternalPage</a>({ ...params }) -> Intercom.ExternalPage</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can create a new external page by sending a POST request to this endpoint. If an external page already exists with the specified source_id and external_id, it will be updated instead.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.createExternalPage({
title: "Test",
html: "<html><body><h1>Test</h1></body></html>",
url: "https://www.example.com",
source_id: 44,
external_id: "abc1234"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateExternalPageRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">getExternalPage</a>({ ...params }) -> Intercom.ExternalPage</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can retrieve an external page.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.getExternalPage({
page_id: "page_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.GetExternalPageRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">updateExternalPage</a>({ ...params }) -> Intercom.ExternalPage</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can update an existing external page (if it was created via the API).
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.updateExternalPage({
page_id: "page_id",
title: "Test",
html: "<html><body><h1>Test</h1></body></html>",
url: "https://www.example.com",
source_id: 47,
external_id: "5678"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.UpdateExternalPageRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.aiContent.<a href="/src/api/resources/aiContent/client/Client.ts">deleteExternalPage</a>({ ...params }) -> Intercom.ExternalPage</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.aiContent.deleteExternalPage({
page_id: "page_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DeleteExternalPageRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `AiContentClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Articles
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">list</a>({ ...params }) -> core.Page<Intercom.ArticleListItem, Intercom.ArticleList></code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of all articles by making a GET request to `https://api.intercom.io/articles`.
> 📘 How are the articles sorted and ordered?
>
> Articles will be returned in descending order on the `updated_at` attribute. This means if you need to iterate through results then we'll show the most recently updated articles first.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
const pageableResponse = await client.articles.list();
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.articles.list();
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListArticlesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">create</a>({ ...params }) -> Intercom.Article</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can create a new article by making a POST request to `https://api.intercom.io/articles`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.articles.create({
title: "Thanks for everything",
description: "Description of the Article",
body: "Body of the Article",
author_id: 991267497,
state: "published",
parent_id: 145,
parent_type: "collection",
translated_content: {
fr: {
title: "Merci pour tout",
description: "Description de l'article",
body: "Corps de l'article",
author_id: 991267497,
state: "published"
}
}
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">find</a>({ ...params }) -> Intercom.Article</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch the details of a single article by making a GET request to `https://api.intercom.io/articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.articles.find({
article_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.FindArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">update</a>({ ...params }) -> Intercom.Article</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can update the details of a single article by making a PUT request to `https://api.intercom.io/articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.articles.update({
article_id: 1,
title: "Christmas is here!",
body: "<p>New gifts in store for the jolly season</p>"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.UpdateArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">delete</a>({ ...params }) -> Intercom.DeletedArticleObject</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can delete a single article by making a DELETE request to `https://api.intercom.io/articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.articles.delete({
article_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DeleteArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.articles.<a href="/src/api/resources/articles/client/Client.ts">search</a>({ ...params }) -> Intercom.ArticleSearchResponse</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can search for articles by making a GET request to `https://api.intercom.io/articles/search`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.articles.search({
phrase: "Getting started",
state: "published",
help_center_id: 1,
highlight: true
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.SearchArticlesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Away Status Reasons
<details><summary><code>client.awayStatusReasons.<a href="/src/api/resources/awayStatusReasons/client/Client.ts">listAwayStatusReasons</a>() -> Intercom.AwayStatusReason[]</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
Returns a list of all away status reasons configured for the workspace, including deleted ones.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.awayStatusReasons.listAwayStatusReasons();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `AwayStatusReasonsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Export
<details><summary><code>client.export.<a href="/src/api/resources/export/client/Client.ts">enqueueANewReportingDataExportJob</a>({ ...params }) -> Intercom.PostExportReportingDataEnqueueResponse</code></summary>
<dl>
<dd>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.export.enqueueANewReportingDataExportJob({
dataset_id: "conversation",
attribute_ids: ["conversation_id", "conversation_started_at"],
start_time: 1717490000,
end_time: 1717510000
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.PostExportReportingDataEnqueueRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.export.<a href="/src/api/resources/export/client/Client.ts">listAvailableDatasetsAndAttributes</a>() -> Intercom.GetExportReportingDataGetDatasetsResponse</code></summary>
<dl>
<dd>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.export.listAvailableDatasetsAndAttributes();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `ExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Data Export
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">exportReportingData</a>({ ...params }) -> Intercom.DataExportExportReportingDataResponse</code></summary>
<dl>
<dd>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.exportReportingData({
job_identifier: "job_identifier",
app_id: "app_id",
client_id: "client_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ExportReportingDataRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">downloadReportingDataExport</a>({ ...params }) -> void</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
Download the data from a completed reporting data export job.
> Octet header required
>
> You will have to specify the header Accept: `application/octet-stream` when hitting this endpoint.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.downloadReportingDataExport({
job_identifier: "job_identifier",
app_id: "app_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DownloadReportingDataExportRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">create</a>({ ...params }) -> Intercom.DataExport</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
To create your export job, you need to send a `POST` request to the export endpoint `https://api.intercom.io/export/content/data`.
The only parameters you need to provide are the range of dates that you want exported.
>🚧 Limit of one active job
>
> You can only have one active job per workspace. You will receive a HTTP status code of 429 with the message Exceeded rate limit of 1 pending message data export jobs if you attempt to create a second concurrent job.
>❗️ Updated_at not included
>
> It should be noted that the timeframe only includes messages sent during the time period and not messages that were only updated during this period. For example, if a message was updated yesterday but sent two days ago, you would need to set the created_at_after date before the message was sent to include that in your retrieval job.
>📘 Date ranges are inclusive
>
> Requesting data for 2018-06-01 until 2018-06-30 will get all data for those days including those specified - e.g. 2018-06-01 00:00:00 until 2018-06-30 23:59:99.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.create({
created_at_after: 1734519776,
created_at_before: 1734537776
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateDataExportRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">find</a>({ ...params }) -> Intercom.DataExport</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can view the status of your job by sending a `GET` request to the URL
`https://api.intercom.io/export/content/data/{job_identifier}` - the `{job_identifier}` is the value returned in the response when you first created the export job. More on it can be seen in the Export Job Model.
> 🚧 Jobs expire after two days
> All jobs that have completed processing (and are thus available to download from the provided URL) will have an expiry limit of two days from when the export ob completed. After this, the data will no longer be available.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.find({
job_identifier: "job_identifier"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.FindDataExportRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">cancel</a>({ ...params }) -> Intercom.DataExport</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can cancel your job
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.cancel({
job_identifier: "job_identifier"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CancelDataExportRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.dataExport.<a href="/src/api/resources/dataExport/client/Client.ts">download</a>({ ...params }) -> void</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
When a job has a status of complete, and thus a filled download_url, you can download your data by hitting that provided URL, formatted like so: https://api.intercom.io/download/content/data/xyz1234.
Your exported message data will be streamed continuously back down to you in a gzipped CSV format.
> 📘 Octet header required
>
> You will have to specify the header Accept: `application/octet-stream` when hitting this endpoint.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.dataExport.download({
job_identifier: "job_identifier"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DownloadDataExportRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `DataExportClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## HelpCenters
<details><summary><code>client.helpCenters.<a href="/src/api/resources/helpCenters/client/Client.ts">find</a>({ ...params }) -> Intercom.HelpCenter</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch the details of a single Help Center by making a GET request to `https://api.intercom.io/help_center/help_center/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.helpCenters.find({
help_center_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.FindHelpCenterRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `HelpCentersClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.helpCenters.<a href="/src/api/resources/helpCenters/client/Client.ts">list</a>({ ...params }) -> core.Page<Intercom.HelpCenter, Intercom.HelpCenterList></code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can list all Help Centers by making a GET request to `https://api.intercom.io/help_center/help_centers`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
const pageableResponse = await client.helpCenters.list();
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.helpCenters.list();
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListHelpCentersRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `HelpCentersClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Internal Articles
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">listInternalArticles</a>() -> Intercom.InternalArticleList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of all internal articles by making a GET request to `https://api.intercom.io/internal_articles`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.listInternalArticles();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">createInternalArticle</a>({ ...params }) -> Intercom.InternalArticle</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can create a new internal article by making a POST request to `https://api.intercom.io/internal_articles`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.createInternalArticle({
title: "Thanks for everything",
body: "Body of the Article",
author_id: 991266252,
owner_id: 991266252
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateInternalArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">retrieveInternalArticle</a>({ ...params }) -> Intercom.InternalArticle</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch the details of a single internal article by making a GET request to `https://api.intercom.io/internal_articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.retrieveInternalArticle({
internal_article_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.RetrieveInternalArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">updateInternalArticle</a>({ ...params }) -> Intercom.InternalArticle</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can update the details of a single internal article by making a PUT request to `https://api.intercom.io/internal_articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.updateInternalArticle({
internal_article_id: 1,
title: "Christmas is here!",
body: "<p>New gifts in store for the jolly season</p>"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.UpdateInternalArticleRequestBody`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">deleteInternalArticle</a>({ ...params }) -> Intercom.DeletedInternalArticleObject</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can delete a single internal article by making a DELETE request to `https://api.intercom.io/internal_articles/<id>`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.deleteInternalArticle({
internal_article_id: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DeleteInternalArticleRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.internalArticles.<a href="/src/api/resources/internalArticles/client/Client.ts">searchInternalArticles</a>({ ...params }) -> Intercom.InternalArticleSearchResponse</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can search for internal articles by making a GET request to `https://api.intercom.io/internal_articles/search`.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.internalArticles.searchInternalArticles({
folder_id: "folder_id"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.SearchInternalArticlesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `InternalArticlesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## IP Allowlist
<details><summary><code>client.ipAllowlist.<a href="/src/api/resources/ipAllowlist/client/Client.ts">getIpAllowlist</a>() -> Intercom.IpAllowlist</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
Retrieve the current IP allowlist configuration for the workspace.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.ipAllowlist.getIpAllowlist();
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**requestOptions:** `IpAllowlistClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.ipAllowlist.<a href="/src/api/resources/ipAllowlist/client/Client.ts">updateIpAllowlist</a>({ ...params }) -> Intercom.IpAllowlist</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
Update the IP allowlist configuration for the workspace.
{% admonition type="warning" name="Lockout Protection" %}
The API will reject updates that would lock out the caller's IP address. Ensure your current IP is included in the allowlist when enabling the feature.
{% /admonition %}
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.ipAllowlist.updateIpAllowlist({
enabled: true,
ip_allowlist: ["192.168.1.0/24", "10.0.0.1"]
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.IpAllowlist`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `IpAllowlistClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Companies
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">retrieve</a>({ ...params }) -> Intercom.CompaniesRetrieveResponse</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a single company by passing in `company_id` or `name`.
`https://api.intercom.io/companies?name={name}`
`https://api.intercom.io/companies?company_id={company_id}`
You can fetch all companies and filter by `segment_id` or `tag_id` as a query parameter.
`https://api.intercom.io/companies?tag_id={tag_id}`
`https://api.intercom.io/companies?segment_id={segment_id}`
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.retrieve({
name: "my company",
company_id: "12345",
tag_id: "678910",
segment_id: "98765",
page: 1,
per_page: 1
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.RetrieveCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">createOrUpdate</a>({ ...params }) -> Intercom.Company</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can create or update a company.
Companies will be only visible in Intercom when there is at least one associated user.
Companies are looked up via `company_id` in a `POST` request, if not found via `company_id`, the new company will be created, if found, that company will be updated.
{% admonition type="warning" name="Using `company_id`" %}
You can set a unique `company_id` value when creating a company. However, it is not possible to update `company_id`. Be sure to set a unique value once upon creation of the company.
{% /admonition %}
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.createOrUpdate({
name: "my company",
company_id: "company_remote_id",
remote_created_at: 1374138000
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.CreateOrUpdateCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">find</a>({ ...params }) -> Intercom.Company</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a single company.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.find({
company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.FindCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">update</a>({ ...params }) -> Intercom.Company</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can update a single company using the Intercom provisioned `id`.
{% admonition type="warning" name="Using `company_id`" %}
When updating a company it is not possible to update `company_id`. This can only be set once upon creation of the company.
{% /admonition %}
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.update({
company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632",
body: {
name: "my company",
website: "http://www.mycompany.com/"
}
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.UpdateCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">delete</a>({ ...params }) -> Intercom.DeletedCompanyObject</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can delete a single company.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.delete({
company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DeleteCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">listAttachedContacts</a>({ ...params }) -> Intercom.CompanyAttachedContacts</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of all contacts that belong to a company.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.listAttachedContacts({
company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListAttachedContactsRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">listAttachedSegments</a>({ ...params }) -> Intercom.CompanyAttachedSegments</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of all segments that belong to a company.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.listAttachedSegments({
company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListSegmentsAttachedToCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">list</a>({ ...params }) -> core.Page<Intercom.Company, Intercom.CompanyList></code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can list companies. The company list is sorted by the `last_request_at` field and by default is ordered descending, most recently requested first.
Note that the API does not include companies who have no associated users in list responses.
When using the Companies endpoint and the pages object to iterate through the returned companies, there is a limit of 10,000 Companies that can be returned. If you need to list or iterate on more than 10,000 Companies, please use the [Scroll API](https://developers.intercom.com/reference#iterating-over-all-companies).
{% admonition type="warning" name="Pagination" %}
You can use pagination to limit the number of results returned. The default is `20` results per page.
See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#pagination-for-list-apis) for more details on how to use the `starting_after` param.
{% /admonition %}
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
const pageableResponse = await client.companies.list({
page: 1,
per_page: 1,
order: "desc"
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.companies.list({
page: 1,
per_page: 1,
order: "desc"
});
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListCompaniesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">scroll</a>({ ...params }) -> core.Page<Intercom.Company, Intercom.CompanyScroll | undefined></code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
The `list all companies` functionality does not work well for huge datasets, and can result in errors and performance problems when paging deeply. The Scroll API provides an efficient mechanism for iterating over all companies in a dataset.
- Each app can only have 1 scroll open at a time. You'll get an error message if you try to have more than one open per app.
- If the scroll isn't used for 1 minute, it expires and calls with that scroll param will fail
- If the end of the scroll is reached, "companies" will be empty and the scroll parameter will expire
{% admonition type="info" name="Scroll Parameter" %}
You can get the first page of companies by simply sending a GET request to the scroll endpoint.
For subsequent requests you will need to use the scroll parameter from the response.
{% /admonition %}
{% admonition type="danger" name="Scroll network timeouts" %}
Since scroll is often used on large datasets network errors such as timeouts can be encountered. When this occurs you will see a HTTP 500 error with the following message:
"Request failed due to an internal network error. Please restart the scroll operation."
If this happens, you will need to restart your scroll query: It is not possible to continue from a specific point when using scroll.
{% /admonition %}
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
const pageableResponse = await client.companies.scroll({
scroll_param: "scroll_param"
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.companies.scroll({
scroll_param: "scroll_param"
});
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ScrollCompaniesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">attachContact</a>({ ...params }) -> Intercom.Company</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can attach a company to a single contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.attachContact({
contact_id: "contact_id",
id: "6762f09a1bb69f9f2193bb34"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.AttachContactToCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.companies.<a href="/src/api/resources/companies/client/Client.ts">detachContact</a>({ ...params }) -> Intercom.Company</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can detach a company from a single contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.companies.detachContact({
contact_id: "58a430d35458202d41b1e65b",
company_id: "58a430d35458202d41b1e65b"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DetachContactFromCompanyRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `CompaniesClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
## Contacts
<details><summary><code>client.contacts.<a href="/src/api/resources/contacts/client/Client.ts">listAttachedCompanies</a>({ ...params }) -> core.Page<Intercom.Company, Intercom.ContactAttachedCompanies></code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of companies that are associated to a contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
const pageableResponse = await client.contacts.listAttachedCompanies({
contact_id: "63a07ddf05a32042dffac965",
page: 1,
per_page: 1
});
for await (const item of pageableResponse) {
console.log(item);
}
// Or you can manually iterate page-by-page
let page = await client.contacts.listAttachedCompanies({
contact_id: "63a07ddf05a32042dffac965",
page: 1,
per_page: 1
});
while (page.hasNextPage()) {
page = page.getNextPage();
}
// You can also access the underlying response
const response = page.response;
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListAttachedCompaniesRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ContactsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.contacts.<a href="/src/api/resources/contacts/client/Client.ts">listAttachedSegments</a>({ ...params }) -> Intercom.ContactSegments</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of segments that are associated to a contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.contacts.listAttachedSegments({
contact_id: "63a07ddf05a32042dffac965"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListSegmentsAttachedToContactRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ContactsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.contacts.<a href="/src/api/resources/contacts/client/Client.ts">listAttachedSubscriptions</a>({ ...params }) -> Intercom.SubscriptionTypeList</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can fetch a list of subscription types that are attached to a contact. These can be subscriptions that a user has 'opted-in' to or has 'opted-out' from, depending on the subscription type.
This will return a list of Subscription Type objects that the contact is associated with.
The data property will show a combined list of:
1.Opt-out subscription types that the user has opted-out from.
2.Opt-in subscription types that the user has opted-in to receiving.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.contacts.listAttachedSubscriptions({
contact_id: "63a07ddf05a32042dffac965"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.ListAttachedSubscriptionsRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ContactsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.contacts.<a href="/src/api/resources/contacts/client/Client.ts">attachSubscription</a>({ ...params }) -> Intercom.SubscriptionType</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can add a specific subscription to a contact. In Intercom, we have two different subscription types based on user consent - opt-out and opt-in:
1.Attaching a contact to an opt-out subscription type will opt that user out from receiving messages related to that subscription type.
2.Attaching a contact to an opt-in subscription type will opt that user in to receiving messages related to that subscription type.
This will return a subscription type model for the subscription type that was added to the contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.contacts.attachSubscription({
contact_id: "63a07ddf05a32042dffac965",
id: "37846",
consent_type: "opt_in"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.AttachSubscriptionToContactRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ContactsClient.RequestOptions`
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</details>
<details><summary><code>client.contacts.<a href="/src/api/resources/contacts/client/Client.ts">detachSubscription</a>({ ...params }) -> Intercom.SubscriptionType</code></summary>
<dl>
<dd>
#### 📝 Description
<dl>
<dd>
<dl>
<dd>
You can remove a specific subscription from a contact. This will return a subscription type model for the subscription type that was removed from the contact.
</dd>
</dl>
</dd>
</dl>
#### 🔌 Usage
<dl>
<dd>
<dl>
<dd>
```typescript
await client.contacts.detachSubscription({
contact_id: "63a07ddf05a32042dffac965",
subscription_id: "37846"
});
```
</dd>
</dl>
</dd>
</dl>
#### ⚙️ Parameters
<dl>
<dd>
<dl>
<dd>
**request:** `Intercom.DetachSubscriptionFromContactRequest`
</dd>
</dl>
<dl>
<dd>
**requestOptions:** `ContactsClient.RequestOpt