### Install Project Dependencies Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md Use this command to install all necessary dependencies for the project. Ensure Node.js 20+ and pnpm are installed. ```bash pnpm install ``` -------------------------------- ### Install Intercom TypeScript Library Source: https://github.com/intercom/intercom-node/blob/master/README.md Install the intercom-client package using npm. ```sh npm i -s intercom-client ``` -------------------------------- ### Example: String Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a String value for an event property. ```json "source":"desktop" ``` -------------------------------- ### GET /help_center/help_center/{id} Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a single Help Center by its ID. ```APIDOC ## GET /help_center/help_center/{id} ### Description Fetches the details of a single Help Center by making a GET request to the specified endpoint. ### Method GET ### Endpoint https://api.intercom.io/help_center/help_center/ ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the Help Center to retrieve. ### Response #### Success Response (200) - **helpCenter** (object) - Details of the Help Center. #### Response Example ```json { "helpCenter": { "id": 1, "name": "Example Help Center" } } ``` ``` -------------------------------- ### Example: Number Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a Number value for an event property. ```json "load": 3.67 ``` -------------------------------- ### Example: Date Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a Date value for an event property. The key must end with `_date` and the value should be a Unix timestamp in UTC. ```json "contact_date": 1392036272 ``` -------------------------------- ### Example: Link Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a Link value for an event property. The value must be a valid HTTP or HTTPS URI. ```json "article": "https://example.org/ab1de.html" ``` -------------------------------- ### GET /help_center/collections/{id} Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a single help center collection by its ID. ```APIDOC ## GET /help_center/collections/{id} ### Description You can fetch the details of a single collection by making a GET request to `https://api.intercom.io/help_center/collections/`. ### Method GET ### Endpoint /help_center/collections/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the collection to retrieve. ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the collection. - **name** (string) - The name of the collection. - **updated_at** (integer) - Timestamp when the collection was last updated. ``` -------------------------------- ### Example: Rich Link Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a Rich Link value for an event property. This requires a JSON object with `url` and `value` keys. ```json "article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"} ``` -------------------------------- ### GET /help_center/collections Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all help center collections, ordered by the most recently updated. ```APIDOC ## GET /help_center/collections ### Description You can fetch a list of all collections by making a GET request to `https://api.intercom.io/help_center/collections`. Collections 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 collections first. ### Method GET ### Endpoint /help_center/collections ### Response #### Success Response (200) - **collections** (array) - A list of help center collections. - **id** (integer) - The unique identifier for the collection. - **name** (string) - The name of the collection. - **updated_at** (integer) - Timestamp when the collection was last updated. ``` -------------------------------- ### Example: Monetary Amount Event Data Source: https://github.com/intercom/intercom-node/blob/master/reference.md Demonstrates how to send a Monetary Amount value for an event property. The value must be a JSON object with `amount` (in cents) and `currency` keys. ```json "price": {"amount": 34999, "currency": "eur"} ``` -------------------------------- ### Get IP Allowlist Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves the current IP allowlist configuration for the workspace. No parameters are required. ```typescript await client.ipAllowlist.getIpAllowlist(); ``` -------------------------------- ### Build the Project Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md Execute this command to build the project. This is typically done after making code changes or before testing. ```bash pnpm build ``` -------------------------------- ### Get Macro Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve a specific macro by its ID. ```APIDOC ## GET /intercom/intercom-node/unstable/macros/getMacro ### Description Retrieve a specific macro by its ID. ### Method GET ### Endpoint /intercom/intercom-node/unstable/macros/getMacro ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the macro to retrieve. ### Request Example (No request body for GET requests, parameters are typically in query string or path) ### Response #### Success Response (200) - **macro** (object) - The macro object. - **id** (string) - The unique identifier for the macro. - **name** (string) - The name of the macro. - **updated_at** (integer) - Timestamp of the last update. - **labels** (array) - Labels associated with the macro. - **short_code** (string) - A short code for the macro. - **description** (string) - A description of the macro. - **message** (object) - The content of the macro message. #### Response Example { "macro": { "id": "456", "name": "Follow-up Question", "updated_at": 1719493750, "labels": ["follow-up"], "short_code": "/followup", "description": "Ask a follow-up question.", "message": { "subject": "Regarding your inquiry", "body": "Do you have any further questions?" } } } ``` -------------------------------- ### Client Initialization Source: https://context7.com/intercom/intercom-node/llms.txt Initialize the IntercomClient with your API token and optional configuration settings. ```APIDOC ## Client Initialization Initialize the IntercomClient with your API token and optional configuration settings. ```typescript import { IntercomClient, logging } from "intercom-client"; const client = new IntercomClient({ token: "YOUR_ACCESS_TOKEN", version: "2.11", // Optional: specify API version (defaults to 2.14) timeoutInSeconds: 30, // Optional: default timeout maxRetries: 3, // Optional: default is 2 logging: { level: logging.LogLevel.Debug, logger: new logging.ConsoleLogger(), silent: false } }); ``` ``` -------------------------------- ### Create an Article Source: https://context7.com/intercom/intercom-node/llms.txt Use this to create a new help center article. Supports rich text bodies and translated content. ```typescript const article = await client.articles.create({ title: "Getting Started Guide", description: "Learn how to get started with our platform", body: "

Welcome

This guide will help you get started...

", author_id: 991267497, state: "published", parent_id: 145, parent_type: "collection", translated_content: { fr: { title: "Guide de Démarrage", description: "Apprenez à démarrer", body: "

Bienvenue

", author_id: 991267497, state: "published" } } }); console.log(`Article created: ${article.id}`); ``` -------------------------------- ### GET /internal_articles Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves a list of all internal articles. ```APIDOC ## GET /internal_articles ### Description Fetches a list of all internal articles by making a GET request to the specified endpoint. ### Method GET ### Endpoint https://api.intercom.io/internal_articles ### Response #### Success Response (200) - **internalArticles** (array) - A list of internal article objects. #### Response Example ```json { "internalArticles": [ { "id": 1, "title": "Example Article 1" }, { "id": 2, "title": "Example Article 2" } ] } ``` ``` -------------------------------- ### GET /data_export/reporting/download Source: https://github.com/intercom/intercom-node/blob/master/reference.md Downloads the exported reporting data. ```APIDOC ## GET /data_export/reporting/download ### Description Downloads the previously exported reporting data. This endpoint is typically used to retrieve the actual data files after an export job has been completed. ### Method GET ### Endpoint /data_export/reporting/download ### Query Parameters - **job_id** (string) - Required - The ID of the completed export job to download. ### Response #### Success Response (200) - The response body will contain the exported data, typically in a file format like CSV or JSON. #### Response Example (Response content will vary based on the exported data format) ``` -------------------------------- ### GET /unstable/teams/listTeams Source: https://github.com/intercom/intercom-node/blob/master/reference.md This will return a list of team objects for the App. ```APIDOC ## GET /unstable/teams/listTeams ### Description This will return a list of team objects for the App. ### Method GET ### Endpoint /unstable/teams/listTeams ### Parameters No parameters are required for this endpoint. ### Response #### Success Response (200) - **teams** (array) - A list of team objects. #### Response Example ```json { "teams": [ { "id": "team-123", "name": "Support Team", "created_at": 1678886400 } ] } ``` ``` -------------------------------- ### POST /intercom/unstable/customObjectInstances/create Source: https://github.com/intercom/intercom-node/blob/master/reference.md Create or update a custom object instance. ```APIDOC ## POST /intercom/unstable/customObjectInstances/create ### Description Create or update a custom object instance. ### Method POST ### Endpoint /intercom/unstable/customObjectInstances/create ### Parameters #### Request Body - **custom_object_type_identifier** (string) - Required - The identifier of the custom object type. - **external_id** (string) - Required - The external ID of the custom object instance. - **external_created_at** (integer) - Required - The external creation timestamp. - **external_updated_at** (integer) - Required - The external update timestamp. - **custom_attributes** (object) - Required - A key-value map of custom attributes. - **order_number** (string) - Example value. - **total_amount** (string) - Example value. ### Request Example ```json { "custom_object_type_identifier": "Order", "external_id": "123", "external_created_at": 1392036272, "external_updated_at": 1392036272, "custom_attributes": { "order_number": "ORDER-12345", "total_amount": "custom_attributes" } } ``` ### Response #### Success Response (200) - **Intercom.CustomObjectInstance | undefined** - The created or updated custom object instance or undefined. ``` -------------------------------- ### GET /intercom/intercom-node/news Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all news items available. ```APIDOC ## GET /intercom/intercom-node/news ### Description Fetches a list of all news items available. ### Method GET ### Endpoint /intercom/intercom-node/news ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```typescript await client.unstable.news.listNewsItems(); ``` ### Response #### Success Response (200) - **data** (array) - A list of news item objects. - **total_count** (integer) - The total number of news items. #### Response Example ```json { "data": [ { "id": "news_1", "title": "New Feature Launch", "published_at": 1678886400 } ], "total_count": 5 } ``` ``` -------------------------------- ### Get Job Status Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve the status of a job execution. ```APIDOC ## GET /intercom/intercom-node/unstable/jobs/status ### Description Retrieve the status of job execution. ### Method GET ### Endpoint /intercom/intercom-node/unstable/jobs/status ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the job. ### Request Example (No request body for GET requests, parameters are typically in query string or path) ### Response #### Success Response (200) - **status** (string) - The current status of the job (e.g., "processing", "completed", "failed"). - **progress** (integer) - The percentage of job completion. #### Response Example { "status": "completed", "progress": 100 } ``` -------------------------------- ### Workflow: Run Tests and Linting Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md Before committing, run tests and linting to ensure code quality and prevent regressions. Use `pnpm test` for tests and `pnpm run check:fix` for linting and formatting. ```bash pnpm test ``` ```bash pnpm run check:fix ``` -------------------------------- ### GET /intercom/unstable/customObjectInstances/getByExternalId Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch a Custom Object Instance by external_id. ```APIDOC ## GET /intercom/unstable/customObjectInstances/getByExternalId ### Description Fetch a Custom Object Instance by external_id. ### Method GET ### Endpoint /intercom/unstable/customObjectInstances/getByExternalId ### Parameters #### Query Parameters - **custom_object_type_identifier** (string) - Required - The identifier of the custom object type. - **external_id** (string) - Required - The external ID of the custom object instance. ### Response #### Success Response (200) - **Intercom.CustomObjectInstance | undefined** - The custom object instance or undefined if not found. ``` -------------------------------- ### Instantiate and Use Intercom Client Source: https://github.com/intercom/intercom-node/blob/master/README.md Instantiate the IntercomClient with your API token and make a request to create an AI content import source. ```typescript import { IntercomClient } from "intercom-client"; const client = new IntercomClient({ token: "YOUR_TOKEN" }); await client.aiContent.createContentImportSource({ url: "https://www.example.com" }); ``` -------------------------------- ### GET /intercom/intercom-node/unstable/aiContent/getExternalPage Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves a specific external page by its ID. ```APIDOC ## GET /intercom/intercom-node/unstable/aiContent/getExternalPage ### Description You can retrieve an external page. ### Method GET ### Endpoint `/intercom/intercom-node/unstable/aiContent/getExternalPage` ### Parameters #### Request Body - **request** (Intercom.unstable.GetExternalPageRequest) - Required - The request object containing the ID of the external page to retrieve. - **requestOptions** (AiContentClient.RequestOptions) - Optional - Options for the request. ### Request Example ```json { "id": "id" } ``` ### Response #### Success Response (200) - **external_page** (Intercom.ExternalPage) - The retrieved external page object. #### Response Example ```json { "id": "string", "title": "string", "url": "string", "source_id": 0, "external_id": "string", "created_at": 0, "updated_at": 0 } ``` ``` -------------------------------- ### GET /intercom/intercom-node/unstable/aiContent/listExternalPages Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves a list of all external pages for a workspace. ```APIDOC ## GET /intercom/intercom-node/unstable/aiContent/listExternalPages ### Description You can retrieve a list of all external pages for a workspace. ### Method GET ### Endpoint `/intercom/intercom-node/unstable/aiContent/listExternalPages` ### Parameters #### Query Parameters - **requestOptions** (AiContentClient.RequestOptions) - Optional - Options for the request. ### Request Example (No request body) ### Response #### Success Response (200) - **external_pages** (Intercom.ExternalPagesList) - A list of external pages. #### Response Example ```json { "external_pages": [ { "id": "string", "title": "string", "url": "string", "source_id": 0, "external_id": "string", "created_at": 0, "updated_at": 0 } ] } ``` ``` -------------------------------- ### GET /articles/search Source: https://github.com/intercom/intercom-node/blob/master/reference.md Searches for articles based on provided criteria. ```APIDOC ## GET /articles/search ### Description Searches for articles using various filters. ### Method GET ### Endpoint /articles/search ### Query Parameters - **phrase** (string) - Optional - The search phrase to look for in articles. - **state** (string) - Optional - Filters articles by their state (e.g., 'published', 'draft'). - **help_center_id** (number) - Optional - Filters articles by the help center they belong to. - **highlight** (boolean) - Optional - Whether to highlight search terms in the results. ### Response #### Success Response (200) - **type** (string) - The type of the response, always 'article.list'. - **data** (array) - An array of article objects matching the search criteria. #### Response Example { "type": "article.list", "data": [ { "id": "123", "title": "Getting started with Intercom", "body": "

This article explains how to get started...

" } ] } ``` -------------------------------- ### GET /companies/{id} Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a single company by its Intercom-provided ID. ```APIDOC ## GET /companies/{id} ### Description Fetches a single company by its Intercom-provided ID. ### Method GET ### Endpoint /companies/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The Intercom-provided ID of the company. #### Request Body - **requestOptions** (CompaniesClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.companies.find({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632" }); ``` ### Response #### Success Response (200) - **company** (Intercom.Company) - The company object. #### Response Example ```json { "id": "12345", "name": "Example Company" } ``` ``` -------------------------------- ### List All Help Center Collections Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all help center collections. Collections are returned in descending order of their `updated_at` attribute. ```typescript await client.unstable.helpCenter.listAllCollections(); ``` -------------------------------- ### GET /export/reporting/datasets Source: https://github.com/intercom/intercom-node/blob/master/reference.md Lists available datasets and their attributes for reporting exports. ```APIDOC ## GET /export/reporting/datasets ### Description Lists all available datasets and their corresponding attributes that can be exported. ### Method GET ### Endpoint /export/reporting/datasets ### Response #### Success Response (200) - **type** (string) - The type of the response, always 'reporting_dataset.list'. - **data** (array) - An array of dataset objects, each containing its ID and a list of available attributes. #### Response Example { "type": "reporting_dataset.list", "data": [ { "id": "conversation", "attributes": [ {"id": "conversation_id", "name": "Conversation ID"}, {"id": "conversation_started_at", "name": "Conversation Started At"} ] } ] } ``` -------------------------------- ### Check Code Style Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md Run these commands to check the code style and formatting according to project guidelines. This helps maintain code consistency. ```bash pnpm run lint ``` ```bash pnpm run format:check ``` -------------------------------- ### GET /internal_articles/{id} Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a single internal article by its ID. ```APIDOC ## GET /internal_articles/{id} ### Description Fetches the details of a single internal article by making a GET request to the specified endpoint. ### Method GET ### Endpoint https://api.intercom.io/internal_articles/ ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the internal article to retrieve. ### Response #### Success Response (200) - **internalArticle** (object) - Details of the internal article. #### Response Example ```json { "internalArticle": { "id": 1, "title": "Example Article" } } ``` ``` -------------------------------- ### POST /help_center/collections Source: https://github.com/intercom/intercom-node/blob/master/reference.md Creates a new help center collection. ```APIDOC ## POST /help_center/collections ### Description You can create a new collection by making a POST request to `https://api.intercom.io/help_center/collections.` ### Method POST ### Endpoint /help_center/collections ### Parameters #### Request Body - **name** (string) - Required - The name of the new collection. ### Request Example ```json { "name": "Thanks for everything" } ``` ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the newly created collection. - **name** (string) - The name of the collection. - **updated_at** (integer) - Timestamp when the collection was created or last updated. ``` -------------------------------- ### GET /intercom/intercom-node/unstable/export/listAvailableDatasetsAndAttributes Source: https://github.com/intercom/intercom-node/blob/master/reference.md Lists all available datasets and their attributes for reporting data exports. ```APIDOC ## GET /intercom/intercom-node/unstable/export/listAvailableDatasetsAndAttributes ### Description Lists all available datasets and their attributes for reporting data exports. ### Method GET ### Endpoint /intercom/intercom-node/unstable/export/listAvailableDatasetsAndAttributes ### Response #### Success Response (200) - **datasets** (array) - A list of available datasets. - **id** (string) - The ID of the dataset. - **attributes** (array) - A list of attributes available for the dataset. - **id** (string) - The ID of the attribute. ``` -------------------------------- ### Run Test Suite Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md This command runs the entire test suite for the project. Ensure all tests pass before committing changes. ```bash pnpm test ``` -------------------------------- ### GET /jobs/status Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves the status of a specific job execution using its ID. ```APIDOC ## GET /jobs/status ### Description Retrieve the status of job execution. ### Method GET ### Endpoint /jobs/status ### Parameters #### Query Parameters - **request** (Intercom.JobsStatusRequest) - Required - Request object containing the job ID. - **requestOptions** (JobsClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.jobs.status({ job_id: "job_id" }); ``` ``` -------------------------------- ### Create Help Center Collection Source: https://github.com/intercom/intercom-node/blob/master/reference.md Creates a new help center collection. Requires a name for the collection. ```typescript await client.helpCenters.collections.create({ name: "Thanks for everything" }); ``` -------------------------------- ### List Help Centers - Intercom Node.js Source: https://github.com/intercom/intercom-node/blob/master/reference.md Lists all Help Centers. Supports iteration over pages or manual page fetching. Access to the underlying response is also available. ```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; ``` -------------------------------- ### GET /contacts/{contact_id}/segments Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of segments associated with a contact. ```APIDOC ## GET /contacts/{contact_id}/segments ### Description Fetches a list of segments that are associated to a contact. ### Method GET ### Endpoint /contacts/{contact_id}/segments ### Parameters #### Path Parameters - **contact_id** (string) - Required - The ID of the contact. #### Request Body - **request** (Intercom.ListSegmentsAttachedToContactRequest) - Required - The request object. - **requestOptions** (ContactsClient.RequestOptions) - Optional - Options for the request. ### Request Example ```json { "contact_id": "63a07ddf05a32042dffac965" } ``` ### Response #### Success Response (200) - **[Response fields depend on the Intercom.ContactSegments object]** ``` -------------------------------- ### GET /contacts/{contact_id}/companies Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of companies associated with a contact. ```APIDOC ## GET /contacts/{contact_id}/companies ### Description Fetches a list of companies that are associated with a contact. ### Method GET ### Endpoint /contacts/{contact_id}/companies ### Parameters #### Path Parameters - **contact_id** (string) - Required - The ID of the contact. #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **per_page** (integer) - Optional - The number of items per page. #### Request Body - **request** (Intercom.ListAttachedCompaniesRequest) - Required - The request object containing pagination details. - **requestOptions** (ContactsClient.RequestOptions) - Optional - Options for the request. ### Request Example ```json { "contact_id": "63a07ddf05a32042dffac965", "page": 1, "per_page": 1 } ``` ### Response #### Success Response (200) - **[Response fields depend on the core.Page object]** ``` -------------------------------- ### GET /away_status_reasons Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves a list of all configured away status reasons for the workspace. ```APIDOC ## GET /away_status_reasons ### Description Returns a list of all away status reasons configured for the workspace, including deleted ones. ### Method GET ### Endpoint /away_status_reasons ### Response #### Success Response (200) - **type** (string) - The type of the response, always 'away_status_reason.list'. - **data** (array) - An array of away status reason objects. #### Response Example { "type": "away_status_reason.list", "data": [ { "id": "1", "description": "Out for lunch", "is_default": false } ] } ``` -------------------------------- ### Initialize IntercomClient Source: https://context7.com/intercom/intercom-node/llms.txt Initialize the IntercomClient with your API token and optional configuration settings like API version, timeout, retries, and logging. ```typescript import { IntercomClient, logging } from "intercom-client"; const client = new IntercomClient({ token: "YOUR_ACCESS_TOKEN", version: "2.11", // Optional: specify API version (defaults to 2.14) timeoutInSeconds: 30, // Optional: default timeout maxRetries: 3, // Optional: default is 2 logging: { level: logging.LogLevel.Debug, logger: new logging.ConsoleLogger(), silent: false } }); ``` -------------------------------- ### Help Centers API - List Help Centers Source: https://context7.com/intercom/intercom-node/llms.txt Fetch all help centers. ```APIDOC ## GET /help_centers ### Description Fetch all help centers. ### Method GET ### Endpoint /help_centers ### Response #### Success Response (200) - **helpCenters** (array) - An array of help center objects. - **display_name** (string) - The display name of the help center. #### Response Example ```json [ { "id": "hc_1", "display_name": "Support Center" }, { "id": "hc_2", "display_name": "Knowledge Base" } ] ``` ``` -------------------------------- ### Get Job Status Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve the current status of a job execution using its ID. ```typescript await client.unstable.jobs.status({ id: "id" }); ``` -------------------------------- ### Retrieve a Help Center Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a specific Help Center. Requires the Help Center ID. ```typescript await client.unstable.helpCenter.retrieveHelpCenter({ id: 1 }); ``` -------------------------------- ### List Conversations with Pagination Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch a list of conversations, optionally specifying the page size and a cursor for pagination. The default results per page is 20. See the pagination section for more details on using the `starting_after` parameter. ```typescript const pageableResponse = await client.conversations.list({ per_page: 1, starting_after: "starting_after" }); for await (const item of pageableResponse) { console.log(item); } ``` ```typescript // Or you can manually iterate page-by-page let page = await client.conversations.list({ per_page: 1, starting_after: "starting_after" }); while (page.hasNextPage()) { page = page.getNextPage(); } ``` ```typescript // You can also access the underlying response const response = page.response; ``` -------------------------------- ### Get Intercom Ticket Details Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch the details of a single ticket. Requires `ticket_id`. ```typescript await client.tickets.get({ ticket_id: "ticket_id" }); ``` -------------------------------- ### List Help Centers Source: https://context7.com/intercom/intercom-node/llms.txt Retrieve a list of all help centers available in your Intercom workspace. Logs the display name of each help center. ```typescript const helpCenters = await client.helpCenters.list(); for await (const helpCenter of helpCenters) { console.log(`Help Center: ${helpCenter.display_name}`); } ``` -------------------------------- ### GET /segments/{segment_id} Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a single segment identified by its unique ID. ```APIDOC ## GET /segments/{segment_id} ### Description You can fetch the details of a single segment. ### Method GET ### Endpoint /segments/{segment_id} ### Parameters #### Path Parameters - **segment_id** (string) - Required - The unique identifier of the segment. #### Query Parameters - **requestOptions** (SegmentsClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.segments.find({ segment_id: "123" }); ``` ``` -------------------------------- ### Create Event with Ruby Client Source: https://github.com/intercom/intercom-node/blob/master/reference.md Submit events using the Ruby client by passing a hash describing the event to `Intercom::Event.create`. ```ruby Intercom::Event.create(user_id: '123', event_name: 'Signed up', created_at: Time.now.to_i) ``` -------------------------------- ### GET /contacts/{contact_id}/subscriptions Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of subscription types attached to a contact. ```APIDOC ## GET /contacts/{contact_id}/subscriptions ### Description Fetches 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. ### Method GET ### Endpoint /contacts/{contact_id}/subscriptions ### Parameters #### Path Parameters - **contact_id** (string) - Required - The ID of the contact. #### Request Body - **request** (Intercom.ListAttachedSubscriptionsRequest) - Required - The request object. - **requestOptions** (ContactsClient.RequestOptions) - Optional - Options for the request. ### Request Example ```json { "contact_id": "63a07ddf05a32042dffac965" } ``` ### Response #### Success Response (200) - **[Response fields depend on the Intercom.SubscriptionTypeList object]** ``` -------------------------------- ### List Teams with Intercom Node.js SDK Source: https://github.com/intercom/intercom-node/wiki/Migration-guide Use this method to list all teams. ```javascript teams.list() ``` -------------------------------- ### GET /companies/{id}/segments Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all segments associated with a specific company. ```APIDOC ## GET /companies/{id}/segments ### Description Fetches a list of all segments associated with a specific company. ### Method GET ### Endpoint /companies/{id}/segments ### Parameters #### Path Parameters - **id** (string) - Required - The Intercom-provided ID of the company. #### Request Body - **requestOptions** (CompaniesClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.companies.listAttachedSegments({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632" }); ``` ### Response #### Success Response (200) - **segments** (array) - A list of segment objects associated with the company. #### Response Example ```json [ { "id": "segment_id_1", "name": "Segment One" }, { "id": "segment_id_2", "name": "Segment Two" } ] ``` ``` -------------------------------- ### List All Tags Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch a list of all tags available in the workspace. No parameters are required, but request options can be provided. ```typescript await client.tags.list(); ``` -------------------------------- ### GET /companies/{id}/contacts Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all contacts associated with a specific company. ```APIDOC ## GET /companies/{id}/contacts ### Description Fetches a list of all contacts associated with a specific company. ### Method GET ### Endpoint /companies/{id}/contacts ### Parameters #### Path Parameters - **id** (string) - Required - The Intercom-provided ID of the company. #### Request Body - **requestOptions** (CompaniesClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.companies.listAttachedContacts({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632" }); ``` ### Response #### Success Response (200) - **contacts** (array) - A list of contact objects associated with the company. #### Response Example ```json [ { "id": "contact_id_1", "name": "Contact One" }, { "id": "contact_id_2", "name": "Contact Two" } ] ``` ``` -------------------------------- ### List Available Datasets and Attributes Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all available datasets and their attributes for export. No parameters are required. ```typescript await client.unstable.export.listAvailableDatasetsAndAttributes(); ``` -------------------------------- ### Create a Contact Source: https://context7.com/intercom/intercom-node/llms.txt Create a new user or lead contact in Intercom. Requires email and name, with optional fields like phone, role, external_id, and custom_attributes. ```typescript import { IntercomClient } from "intercom-client"; const client = new IntercomClient({ token: "YOUR_TOKEN" }); // Create a new user contact const contact = await client.contacts.create({ email: "joebloggs@example.com", name: "Joe Bloggs", phone: "+1234567890", role: "user", external_id: "user_12345", custom_attributes: { plan: "premium", signup_date: 1640000000 } }); console.log(`Created contact: ${contact.id}`); ``` -------------------------------- ### List All Email Settings Source: https://github.com/intercom/intercom-node/blob/master/reference.md Lists all sender email address settings for the workspace. This is useful for managing outgoing email configurations. ```typescript await client.unstable.emails.listEmails(); ``` -------------------------------- ### Create Content Import Source Source: https://context7.com/intercom/intercom-node/llms.txt Creates a new content import source for AI content, specifying a URL. ```typescript const source = await client.aiContent.createContentImportSource({ url: "https://docs.example.com" }); console.log(`Source ID: ${source.id}`); ``` -------------------------------- ### GET /unstable/calls/collectFinVoiceCallByExternalId Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve information about a Fin Voice call using the external call identifier. ```APIDOC ## GET /unstable/calls/collectFinVoiceCallByExternalId ### Description Retrieve information about a Fin Voice call using the external call identifier. ### Method GET ### Endpoint /unstable/calls/collectFinVoiceCallByExternalId ### Parameters #### Query Parameters - **external_id** (string) - Required - The external call identifier. - **requestOptions** (object) - Optional - Options for the request. ### Request Example ```json { "external_id": "external_id" } ``` ### Response #### Success Response (200) - **id** (string) - The Intercom call ID. - **external_id** (string) - The external call identifier. - **phone_number** (string) - The phone number associated with the call. - **created_at** (integer) - The timestamp when the call was registered. #### Response Example ```json { "id": "intercom-call-id-xyz", "external_id": "call-123-abc", "phone_number": "+1234567890", "created_at": 1678886400 } ``` ``` -------------------------------- ### List All Contacts with Pagination Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch a list of all contacts in your workspace. Pagination is supported to limit results, with a default of 50 per page. Refer to the pagination section for details on using `starting_after`. ```typescript const pageableResponse = await client.contacts.list(); for await (const item of pageableResponse) { console.log(item); } ``` ```typescript // Or you can manually iterate page-by-page let page = await client.contacts.list(); while (page.hasNextPage()) { page = page.getNextPage(); } // You can also access the underlying response const response = page.response; ``` -------------------------------- ### GET /unstable/calls/collectFinVoiceCallById Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve information about a Fin Voice call using the external reference ID. ```APIDOC ## GET /unstable/calls/collectFinVoiceCallById ### Description Retrieve information about a Fin Voice call using the external reference ID. ### Method GET ### Endpoint /unstable/calls/collectFinVoiceCallById ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier of the Fin Voice call. - **requestOptions** (object) - Optional - Options for the request. ### Request Example ```json { "id": 1 } ``` ### Response #### Success Response (200) - **id** (string) - The Intercom call ID. - **external_id** (string) - The external call identifier. - **phone_number** (string) - The phone number associated with the call. - **created_at** (integer) - The timestamp when the call was registered. #### Response Example ```json { "id": "intercom-call-id-xyz", "external_id": "call-123-abc", "phone_number": "+1234567890", "created_at": 1678886400 } ``` ``` -------------------------------- ### List Macros Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetch a list of all macros (saved replies) in your workspace. Supports pagination and placeholder transformation. ```APIDOC ## GET /intercom/intercom-node/unstable/macros/listMacros ### Description Fetch a list of all macros (saved replies) in your workspace. The macros are returned in descending order by `updated_at`. This endpoint uses cursor-based pagination via the `starting_after` parameter. **Placeholder Transformation:** The API transforms Intercom placeholders to a more standard XML-like format (e.g., `{{user.name | fallback: 'there'}}` becomes ``). ### Method GET ### Endpoint /intercom/intercom-node/unstable/macros/listMacros ### Parameters #### Query Parameters - **per_page** (integer) - Optional - The number of results to return per page. - **starting_after** (string) - Optional - Cursor for pagination, based on `updated_at` and `id`. - **updated_since** (integer) - Optional - Filter macros updated since this timestamp. ### Request Example (No request body for GET requests, parameters are typically in query string or path) ### Response #### Success Response (200) - **data** (array) - An array of macro objects. - **id** (string) - The unique identifier for the macro. - **name** (string) - The name of the macro. - **updated_at** (integer) - Timestamp of the last update. - **labels** (array) - Labels associated with the macro. - **short_code** (string) - A short code for the macro. - **description** (string) - A description of the macro. - **message** (object) - The content of the macro message. - **pagination** (object) - Pagination information. - **next** (string) - Cursor for the next page. #### Response Example { "data": [ { "id": "123", "name": "Welcome Reply", "updated_at": 1719493757, "labels": ["greeting"], "short_code": "/welcome", "description": "Standard welcome message.", "message": { "subject": "Hello!", "body": "Welcome to our service!" } } ], "pagination": { "next": "WzE3MTk0OTM3NTcuMCwgIjEyMyJd" } } ``` -------------------------------- ### Ticket Types API - Get Ticket Type Source: https://github.com/intercom/intercom-node/blob/master/reference.md You can fetch the details of a single ticket type. ```APIDOC ## GET /ticket_types/{ticket_type_id} ### Description You can fetch the details of a single ticket type. ### Method GET ### Endpoint /ticket_types/{ticket_type_id} ### Parameters #### Path Parameters - **ticket_type_id** (string) - Required - The ID of the ticket type to retrieve. #### Query Parameters - **requestOptions** (object) - Optional - Options for the request. ### Response #### Success Response (200) - **ticket_type** (object) - The ticket type object. #### Response Example ```json { "ticket_type": { "id": "ticket_type_id", "name": "Ticket Type Name", "description": "Ticket Type Description", "category": "Ticket Category", "icon": "🎟️" } } ``` ``` -------------------------------- ### Ticket Types API - List Ticket Types Source: https://github.com/intercom/intercom-node/blob/master/reference.md You can get a list of all ticket types for a workspace. ```APIDOC ## GET /ticket_types ### Description You can get a list of all ticket types for a workspace. ### Method GET ### Endpoint /ticket_types ### Parameters #### Query Parameters - **requestOptions** (object) - Optional - Options for the request. ### Response #### Success Response (200) - **ticket_types** (array) - A list of ticket type objects. #### Response Example ```json { "ticket_types": [ { "id": "ticket_type_id", "name": "Ticket Type Name" } ] } ``` ``` -------------------------------- ### List all Help Centers Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieves a list of all Help Centers available in the Intercom account. No parameters are required. ```typescript await client.unstable.helpCenter.listHelpCenters(); ``` -------------------------------- ### Ticket States API - List Ticket States Source: https://github.com/intercom/intercom-node/blob/master/reference.md You can get a list of all ticket states for a workspace. ```APIDOC ## GET /ticket_states ### Description You can get a list of all ticket states for a workspace. ### Method GET ### Endpoint /ticket_states ### Parameters #### Query Parameters - **requestOptions** (object) - Optional - Options for the request. ### Response #### Success Response (200) - **ticket_states** (array) - A list of ticket state objects. #### Response Example ```json { "ticket_states": [ { "id": "ticket_state_id", "name": "Ticket State Name" } ] } ``` ``` -------------------------------- ### Create Content Import Source Source: https://github.com/intercom/intercom-node/blob/master/reference.md Create a new content import source by providing a URL. The URL is a required parameter in the request object. ```typescript await client.unstable.aiContent.createContentImportSource({ url: "https://www.example.com" }); ``` -------------------------------- ### Get Ticket Type by ID Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches the details of a specific ticket type using its ID. ```typescript await client.ticketTypes.get({ ticket_type_id: "ticket_type_id" }); ``` -------------------------------- ### Create an Article - TypeScript Source: https://github.com/intercom/intercom-node/blob/master/reference.md Creates a new article. Requires parameters for the article content. ```typescript await client.unstable.articles.createArticle({ "key": "value" }); ``` -------------------------------- ### GET /segments Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all segments available in Intercom. Can optionally include counts for each segment. ```APIDOC ## GET /segments ### Description You can fetch a list of all segments. ### Method GET ### Endpoint /segments ### Parameters #### Query Parameters - **request** (Intercom.ListSegmentsRequest) - Required - Parameters for listing segments, e.g., `include_count`. - **requestOptions** (SegmentsClient.RequestOptions) - Optional - Additional options for the request. ### Request Example ```typescript await client.segments.list({ include_count: true }); ``` ``` -------------------------------- ### Run Specific Test Types Source: https://github.com/intercom/intercom-node/blob/master/CONTRIBUTING.md Use these commands to run specific types of tests, such as unit or integration tests. This is useful for targeted debugging. ```bash pnpm test:unit ``` ```bash pnpm test:wire ``` -------------------------------- ### Get External Page - Intercom API Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve a specific external page using its page_id. ```typescript await client.aiContent.getExternalPage({ page_id: "page_id" }); ``` -------------------------------- ### List Available Datasets and Attributes for Export Source: https://github.com/intercom/intercom-node/blob/master/reference.md Fetches a list of all available datasets and their corresponding attributes that can be exported from Intercom. ```typescript await client.export.listAvailableDatasetsAndAttributes(); ``` -------------------------------- ### List All Activities Logs using Intercom Node SDK Source: https://github.com/intercom/intercom-node/wiki/Migration-guide Use the `admin.listAllActivities` method to retrieve all activity logs for an admin. This is a new method in v3. ```javascript admin.listAllActivities ``` -------------------------------- ### Get External Page - TypeScript Source: https://github.com/intercom/intercom-node/blob/master/reference.md Retrieve a specific external page by its ID. Requires the page ID. ```typescript await client.unstable.aiContent.getExternalPage({ id: "id" }); ```