# Reference ## Admins
client.admins.identify()
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.admins.identify() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.admins.away(...)
#### 📝 Description
You can set an Admin as away for the Inbox.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.admins.away( admin_id=1, away_mode_enabled=True, away_mode_reassign=True, ) ```
#### ⚙️ Parameters
**admin_id:** `int` — The unique identifier of a given admin
**away_mode_enabled:** `bool` — Set to "true" to change the status of the admin to away.
**away_mode_reassign:** `bool` — Set to "true" to assign any new conversation replies to your default inbox.
**away_status_reason_id:** `typing.Optional[int]` — The unique identifier of the away status reason
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.admins.list_all_activity_logs(...)
#### 📝 Description
You can get a log of activities by all admins in an app.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.admins.list_all_activity_logs( created_at_after="1677253093", created_at_before="1677861493", ) ```
#### ⚙️ Parameters
**created_at_after:** `str` — The start date that you request data for. It must be formatted as a UNIX timestamp.
**created_at_before:** `typing.Optional[str]` — The end date that you request data for. It must be formatted as a UNIX timestamp.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.admins.list()
#### 📝 Description
You can fetch a list of admins for a given workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.admins.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.admins.find(...)
#### 📝 Description
You can retrieve the details of a single admin.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.admins.find( admin_id=1, ) ```
#### ⚙️ Parameters
**admin_id:** `int` — The unique identifier of a given admin
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## AI Content
client.ai_content.list_content_import_sources()
#### 📝 Description
You can retrieve a list of all content import sources for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.list_content_import_sources() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.create_content_import_source(...)
#### 📝 Description
You can create a new content import source by sending a POST request to this endpoint.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.create_content_import_source( url="https://www.example.com", ) ```
#### ⚙️ Parameters
**url:** `str` — The URL of the content import source.
**status:** `typing.Optional[CreateContentImportSourceRequestStatus]` — The status of the content import source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.get_content_import_source(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.get_content_import_source( source_id="source_id", ) ```
#### ⚙️ Parameters
**source_id:** `str` — The unique identifier for the content import source which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.update_content_import_source(...)
#### 📝 Description
You can update an existing content import source.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.update_content_import_source( source_id="source_id", sync_behavior="api", url="https://www.example.com", ) ```
#### ⚙️ Parameters
**source_id:** `str` — The unique identifier for the content import source which is given by Intercom.
**sync_behavior:** `UpdateContentImportSourceRequestSyncBehavior` — If you intend to create or update External Pages via the API, this should be set to `api`. You can not change the value to or from api.
**url:** `str` — The URL of the content import source. This may only be different from the existing value if the sync behavior is API.
**status:** `typing.Optional[UpdateContentImportSourceRequestStatus]` — The status of the content import source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.delete_content_import_source(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.delete_content_import_source( source_id="source_id", ) ```
#### ⚙️ Parameters
**source_id:** `str` — The unique identifier for the content import source which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.list_external_pages()
#### 📝 Description
You can retrieve a list of all external pages for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.list_external_pages() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.create_external_page(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.create_external_page( title="Test", html="

Test

", url="https://www.example.com", source_id=44, external_id="abc1234", ) ```
#### ⚙️ Parameters
**title:** `str` — The title of the external page.
**html:** `str` — The body of the external page in HTML.
**source_id:** `int` — The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
**external_id:** `str` — The identifier for the external page which was given by the source. Must be unique for the source.
**url:** `typing.Optional[str]` — The URL of the external page. This will be used by Fin to link end users to the page it based its answer on. When a URL is not present, Fin will not reference the source.
**ai_agent_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by AI Agent. Will not default when updating an existing external page.
**ai_copilot_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by AI Copilot. Will not default when updating an existing external page.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.get_external_page(...)
#### 📝 Description
You can retrieve an external page.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.get_external_page( page_id="page_id", ) ```
#### ⚙️ Parameters
**page_id:** `str` — The unique identifier for the external page which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.update_external_page(...)
#### 📝 Description
You can update an existing external page (if it was created via the API).
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.update_external_page( page_id="page_id", title="Test", html="

Test

", url="https://www.example.com", source_id=47, external_id="5678", ) ```
#### ⚙️ Parameters
**page_id:** `str` — The unique identifier for the external page which is given by Intercom.
**title:** `str` — The title of the external page.
**html:** `str` — The body of the external page in HTML.
**url:** `str` — The URL of the external page. This will be used by Fin to link end users to the page it based its answer on.
**source_id:** `int` — The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
**fin_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by Fin.
**external_id:** `typing.Optional[str]` — The identifier for the external page which was given by the source. Must be unique for the source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ai_content.delete_external_page(...)
#### 📝 Description
Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ai_content.delete_external_page( page_id="page_id", ) ```
#### ⚙️ Parameters
**page_id:** `str` — The unique identifier for the external page which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Articles
client.articles.list(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.articles.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.articles.create(...)
#### 📝 Description
You can create a new article by making a POST request to `https://api.intercom.io/articles`.
#### 🔌 Usage
```python from intercom import CreateArticleRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.articles.create( request=CreateArticleRequest( title="Thanks for everything", description="Description of the Article", body="Body of the Article", author_id=1295, state="published", ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateArticleRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.articles.find(...)
#### 📝 Description
You can fetch the details of a single article by making a GET request to `https://api.intercom.io/articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.articles.find( article_id=1, ) ```
#### ⚙️ Parameters
**article_id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.articles.update(...)
#### 📝 Description
You can update the details of a single article by making a PUT request to `https://api.intercom.io/articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.articles.update( article_id=1, title="Christmas is here!", body="

New gifts in store for the jolly season

", ) ```
#### ⚙️ Parameters
**article_id:** `int` — The unique identifier for the article which is given by Intercom.
**title:** `typing.Optional[str]` — The title of the article.For multilingual articles, this will be the title of the default language's content.
**description:** `typing.Optional[str]` — The description of the article. For multilingual articles, this will be the description of the default language's content.
**body:** `typing.Optional[str]` — The content of the article. For multilingual articles, this will be the body of the default language's content.
**author_id:** `typing.Optional[int]` — The id of the author of the article. For multilingual articles, this will be the id of the author of the default language's content. Must be a teammate on the help center's workspace.
**state:** `typing.Optional[UpdateArticleRequestState]` — Whether the article will be `published` or will be a `draft`. Defaults to draft. For multilingual articles, this will be the state of the default language's content.
**parent_id:** `typing.Optional[str]` — The id of the article's parent collection or section. An article without this field stands alone.
**parent_type:** `typing.Optional[str]` — The type of parent, which can either be a `collection` or `section`.
**translated_content:** `typing.Optional[ArticleTranslatedContent]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.articles.delete(...)
#### 📝 Description
You can delete a single article by making a DELETE request to `https://api.intercom.io/articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.articles.delete( article_id=1, ) ```
#### ⚙️ Parameters
**article_id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.articles.search(...)
#### 📝 Description
You can search for articles by making a GET request to `https://api.intercom.io/articles/search`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.articles.search( phrase="Getting started", state="published", help_center_id=1, highlight=True, ) ```
#### ⚙️ Parameters
**phrase:** `typing.Optional[str]` — The phrase within your articles to search for.
**state:** `typing.Optional[str]` — The state of the Articles returned. One of `published`, `draft` or `all`.
**help_center_id:** `typing.Optional[int]` — The ID of the Help Center to search in.
**highlight:** `typing.Optional[bool]` — Return a highlighted version of the matching content within your articles. Refer to the response schema for more details.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Away Status Reasons
client.away_status_reasons.list_away_status_reasons()
#### 📝 Description
Returns a list of all away status reasons configured for the workspace, including deleted ones.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.away_status_reasons.list_away_status_reasons() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Export
client.export.enqueue_a_new_reporting_data_export_job(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.export.enqueue_a_new_reporting_data_export_job( dataset_id="conversation", attribute_ids=["conversation_id", "conversation_started_at"], start_time=1717490000, end_time=1717510000, ) ```
#### ⚙️ Parameters
**dataset_id:** `str`
**attribute_ids:** `typing.Sequence[str]`
**start_time:** `int`
**end_time:** `int`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.export.list_available_datasets_and_attributes()
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.export.list_available_datasets_and_attributes() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Data Export
client.data_export.export_reporting_data(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.export_reporting_data( job_identifier="job_identifier", app_id="app_id", client_id="client_id", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — Unique identifier of the job.
**app_id:** `str` — The Intercom defined code of the workspace the company is associated to.
**client_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_export.download_reporting_data_export(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.download_reporting_data_export( job_identifier="job_identifier", app_id="app_id", ) ```
#### ⚙️ Parameters
**job_identifier:** `str`
**app_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_export.create(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.create( created_at_after=1734519776, created_at_before=1734537776, ) ```
#### ⚙️ Parameters
**created_at_after:** `int` — The start date that you request data for. It must be formatted as a unix timestamp.
**created_at_before:** `int` — The end date that you request data for. It must be formatted as a unix timestamp.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_export.find(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.find( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_export.cancel(...)
#### 📝 Description
You can cancel your job
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.cancel( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_export.download(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_export.download( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## HelpCenters
client.help_centers.find(...)
#### 📝 Description
You can fetch the details of a single Help Center by making a GET request to `https://api.intercom.io/help_center/help_center/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.help_centers.find( help_center_id=1, ) ```
#### ⚙️ Parameters
**help_center_id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.help_centers.list(...)
#### 📝 Description
You can list all Help Centers by making a GET request to `https://api.intercom.io/help_center/help_centers`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.help_centers.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Internal Articles
client.internal_articles.list_internal_articles()
#### 📝 Description
You can fetch a list of all internal articles by making a GET request to `https://api.intercom.io/internal_articles`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.list_internal_articles() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.internal_articles.create_internal_article(...)
#### 📝 Description
You can create a new internal article by making a POST request to `https://api.intercom.io/internal_articles`.
#### 🔌 Usage
```python from intercom import CreateInternalArticleRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.create_internal_article( request=CreateInternalArticleRequest( title="Thanks for everything", body="Body of the Internal Article", author_id=1295, owner_id=1295, ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateInternalArticleRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.internal_articles.retrieve_internal_article(...)
#### 📝 Description
You can fetch the details of a single internal article by making a GET request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.retrieve_internal_article( internal_article_id=1, ) ```
#### ⚙️ Parameters
**internal_article_id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.internal_articles.update_internal_article(...)
#### 📝 Description
You can update the details of a single internal article by making a PUT request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.update_internal_article( internal_article_id=1, title="Christmas is here!", body="

New gifts in store for the jolly season

", ) ```
#### ⚙️ Parameters
**internal_article_id:** `int` — The unique identifier for the internal article which is given by Intercom.
**title:** `typing.Optional[str]` — The title of the article.
**body:** `typing.Optional[str]` — The content of the article.
**author_id:** `typing.Optional[int]` — The id of the author of the article.
**owner_id:** `typing.Optional[int]` — The id of the author of the article.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.internal_articles.delete_internal_article(...)
#### 📝 Description
You can delete a single internal article by making a DELETE request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.delete_internal_article( internal_article_id=1, ) ```
#### ⚙️ Parameters
**internal_article_id:** `int` — The unique identifier for the internal article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.internal_articles.search_internal_articles(...)
#### 📝 Description
You can search for internal articles by making a GET request to `https://api.intercom.io/internal_articles/search`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.internal_articles.search_internal_articles( folder_id="folder_id", ) ```
#### ⚙️ Parameters
**folder_id:** `typing.Optional[str]` — The ID of the folder to search in.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## IP Allowlist
client.ip_allowlist.get_ip_allowlist()
#### 📝 Description
Retrieve the current IP allowlist configuration for the workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ip_allowlist.get_ip_allowlist() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ip_allowlist.update_ip_allowlist(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ip_allowlist.update_ip_allowlist( enabled=True, ip_allowlist=["192.168.1.0/24", "10.0.0.1"], ) ```
#### ⚙️ Parameters
**type:** `typing.Optional[str]` — String representing the object's type. Always has the value `ip_allowlist`.
**enabled:** `typing.Optional[bool]` — Whether the IP allowlist is enabled for the workspace.
**ip_allowlist:** `typing.Optional[typing.Sequence[str]]` List of allowed IP addresses and/or IP ranges in CIDR notation. Examples: - Single IP: `192.168.0.1` - IP range: `192.168.0.1/24` (allows 192.168.0.0 - 192.168.0.255)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Companies
client.companies.retrieve(...)
#### 📝 Description
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}`
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.retrieve( name="my company", company_id="12345", tag_id="678910", segment_id="98765", page=1, per_page=1, ) ```
#### ⚙️ Parameters
**name:** `typing.Optional[str]` — The `name` of the company to filter by.
**company_id:** `typing.Optional[str]` — The `company_id` of the company to filter by.
**tag_id:** `typing.Optional[str]` — The `tag_id` of the company to filter by.
**segment_id:** `typing.Optional[str]` — The `segment_id` of the company to filter by.
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.create_or_update(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import CreateOrUpdateCompanyRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.create_or_update( request=CreateOrUpdateCompanyRequest(), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateOrUpdateCompanyRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.find(...)
#### 📝 Description
You can fetch a single company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.find( company_id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.update(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom, UpdateCompanyRequestBody client = Intercom( token="YOUR_TOKEN", ) client.companies.update( company_id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", request=UpdateCompanyRequestBody(), ) ```
#### ⚙️ Parameters
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request:** `typing.Optional[UpdateCompanyRequestBody]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.delete(...)
#### 📝 Description
You can delete a single company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.delete( company_id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.list_attached_contacts(...)
#### 📝 Description
You can fetch a list of all contacts that belong to a company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.list_attached_contacts( company_id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.list_attached_segments(...)
#### 📝 Description
You can fetch a list of all segments that belong to a company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.list_attached_segments( company_id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.list(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.companies.list( page=1, per_page=1, order="desc", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to return per page. Defaults to 15
**order:** `typing.Optional[str]` — `asc` or `desc`. Return the companies in ascending or descending order. Defaults to desc
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.scroll(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.companies.scroll( scroll_param="scroll_param", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**scroll_param:** `typing.Optional[str]` —
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.attach_contact(...)
#### 📝 Description
You can attach a company to a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.attach_contact( contact_id="contact_id", company_id="123", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.companies.detach_contact(...)
#### 📝 Description
You can detach a company from a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.companies.detach_contact( contact_id="58a430d35458202d41b1e65b", company_id="58a430d35458202d41b1e65b", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Contacts
client.contacts.list_attached_companies(...)
#### 📝 Description
You can fetch a list of companies that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.contacts.list_attached_companies( contact_id="63a07ddf05a32042dffac965", page=1, per_page=1, ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.list_attached_segments(...)
#### 📝 Description
You can fetch a list of segments that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.list_attached_segments( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.list_attached_subscriptions(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.list_attached_subscriptions( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.attach_subscription(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.attach_subscription( contact_id="63a07ddf05a32042dffac965", subscription_id="invalid_id", consent_type="opt_in", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**subscription_id:** `str` — The unique identifier for the subscription which is given by Intercom
**consent_type:** `str` — The consent_type of a subscription, opt_out or opt_in.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.detach_subscription(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.detach_subscription( contact_id="63a07ddf05a32042dffac965", subscription_id="37846", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**subscription_id:** `str` — The unique identifier for the subscription type which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.list_attached_tags(...)
#### 📝 Description
You can fetch a list of all tags that are attached to a specific contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.list_attached_tags( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.find(...)
#### 📝 Description
You can fetch the details of a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.find( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — contact_id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.update(...)
#### 📝 Description
You can update an existing contact (ie. user or lead). {% admonition type="info" %} This endpoint handles both **contact updates** and **custom object associations**. See _`update a contact with an association to a custom object instance`_ in the request/response examples to see the custom object association format. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.update( contact_id="63a07ddf05a32042dffac965", custom_attributes={"order": ["21"]}, ) ```
#### ⚙️ Parameters
**contact_id:** `str` — id
**role:** `typing.Optional[str]` — The role of the contact.
**external_id:** `typing.Optional[str]` — A unique identifier for the contact which is given to Intercom
**email:** `typing.Optional[str]` — The contacts email
**phone:** `typing.Optional[str]` — The contacts phone
**name:** `typing.Optional[str]` — The contacts name
**avatar:** `typing.Optional[str]` — An image URL containing the avatar of a contact
**signed_up_at:** `typing.Optional[int]` — The time specified for when a contact signed up
**last_seen_at:** `typing.Optional[int]` — The time when the contact was last seen (either where the Intercom Messenger was installed or when specified manually)
**owner_id:** `typing.Optional[int]` — The id of an admin that has been assigned account ownership of the contact
**unsubscribed_from_emails:** `typing.Optional[bool]` — Whether the contact is unsubscribed from emails
**custom_attributes:** `typing.Optional[typing.Dict[str, typing.Any]]` — The custom attributes which are set for the contact
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.delete(...)
#### 📝 Description
You can delete a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.delete( contact_id="contact_id", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — contact_id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.merge_lead_in_user(...)
#### 📝 Description
You can merge a contact with a `role` of `lead` into a contact with a `role` of `user`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.merge_lead_in_user( lead_id="6762f0d51bb69f9f2193bb7f", contact_id="6762f0d51bb69f9f2193bb80", ) ```
#### ⚙️ Parameters
**lead_id:** `typing.Optional[str]` — The unique identifier for the contact to merge away from. Must be a lead.
**contact_id:** `typing.Optional[str]` — The unique identifier for the contact to merge into. Must be a user.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.search(...)
#### 📝 Description
You can search for multiple contacts by the value of their attributes in order to fetch exactly who you want. To search for contacts, you need to send a `POST` request to `https://api.intercom.io/contacts/search`. This will accept a query object in the body which will define your filters in order to search for contacts. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is `50` results per page. See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Contact Creation Delay If a contact has recently been created, there is a possibility that it will not yet be available when searching. This means that it may not appear in the response. This delay can take a few minutes. If you need to be instantly notified it is recommended to use webhooks and iterate to see if they match your search filters. ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiple's there can be: * There's a limit of max 2 nested filters * There's a limit of max 15 filters for each AND or OR group ### Searching for Timestamp Fields All timestamp fields (created_at, updated_at etc.) are indexed as Dates for Contact Search queries; Datetime queries are not currently supported. This means you can only query for timestamp fields by day - not hour, minute or second. For example, if you search for all Contacts with a created_at value greater (>) than 1577869200 (the UNIX timestamp for January 1st, 2020 9:00 AM), that will be interpreted as 1577836800 (January 1st, 2020 12:00 AM). The search results will then include Contacts created from January 2nd, 2020 12:00 AM onwards. If you'd like to get contacts created on January 1st, 2020 you should search with a created_at value equal (=) to 1577836800 (January 1st, 2020 12:00 AM). This behaviour applies only to timestamps used in search queries. The search results will still contain the full UNIX timestamp and be sorted accordingly. ### Accepted Fields Most key listed as part of the Contacts Model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foorbar"`). | Field | Type | | ---------------------------------- | ------------------------------ | | id | String | | role | String
Accepts user or lead | | name | String | | avatar | String | | owner_id | Integer | | email | String | | email_domain | String | | phone | String | | external_id | String | | created_at | Date (UNIX Timestamp) | | signed_up_at | Date (UNIX Timestamp) | | updated_at | Date (UNIX Timestamp) | | last_seen_at | Date (UNIX Timestamp) | | last_contacted_at | Date (UNIX Timestamp) | | last_replied_at | Date (UNIX Timestamp) | | last_email_opened_at | Date (UNIX Timestamp) | | last_email_clicked_at | Date (UNIX Timestamp) | | language_override | String | | browser | String | | browser_language | String | | os | String | | location.country | String | | location.region | String | | location.city | String | | unsubscribed_from_emails | Boolean | | marked_email_as_spam | Boolean | | has_hard_bounced | Boolean | | ios_last_seen_at | Date (UNIX Timestamp) | | ios_app_version | String | | ios_device | String | | ios_app_device | String | | ios_os_version | String | | ios_app_name | String | | ios_sdk_version | String | | android_last_seen_at | Date (UNIX Timestamp) | | android_app_version | String | | android_device | String | | android_app_name | String | | andoid_sdk_version | String | | segment_id | String | | tag_id | String | | custom_attributes.{attribute_name} | String | ### Accepted Operators {% admonition type="warning" name="Searching based on `created_at`" %} You cannot use the `<=` or `>=` operators to search by `created_at`. {% /admonition %} The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :------------------------------- | :--------------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In
Shortcut for `OR` queries
Values must be in Array | | NIN | All | Not In
Shortcut for `OR !` queries
Values must be in Array | | > | Integer
Date (UNIX Timestamp) | Greater than | | < | Integer
Date (UNIX Timestamp) | Lower than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import ( Intercom, MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) response = client.contacts.search( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.list(...)
#### 📝 Description
You can fetch a list of all contacts (ie. users or leads) in your workspace. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is `50` 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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.contacts.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**starting_after:** `typing.Optional[str]` — String used to get the next page of conversations.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.create(...)
#### 📝 Description
You can create a new contact (ie. user or lead).
#### 🔌 Usage
```python from intercom import CreateContactRequestWithEmail, Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.create( request=CreateContactRequestWithEmail( email="joebloggs@intercom.io", ), ) ```
#### ⚙️ Parameters
**request:** `CreateContactRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.show_contact_by_external_id(...)
#### 📝 Description
You can fetch the details of a single contact by external ID. Note that this endpoint only supports users and not leads.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.show_contact_by_external_id( external_id="cdd29344-5e0c-4ef0-ac56-f9ba2979bc27", ) ```
#### ⚙️ Parameters
**external_id:** `str` — The external ID of the user that you want to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.archive(...)
#### 📝 Description
You can archive a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.archive( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — contact_id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.unarchive(...)
#### 📝 Description
You can unarchive a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.unarchive( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — contact_id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.contacts.block_contact(...)
#### 📝 Description
Block a single contact.
**Note:** conversations of the contact will also be archived during the process.
More details in [FAQ How do I block Inbox spam?](https://www.intercom.com/help/en/articles/8838656-inbox-faqs)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.contacts.block_contact( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — contact_id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Notes
client.notes.list(...)
#### 📝 Description
You can fetch a list of notes that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.notes.list( contact_id="contact_id", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier of a contact.
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.notes.create(...)
#### 📝 Description
You can add a note to a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.notes.create( contact_id="123", body="Hello", admin_id="123", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier of a given contact.
**body:** `str` — The text of the note.
**admin_id:** `typing.Optional[str]` — The unique identifier of a given admin.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.notes.find(...)
#### 📝 Description
You can fetch the details of a single note.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.notes.find( note_id=1, ) ```
#### ⚙️ Parameters
**note_id:** `int` — The unique identifier of a given note
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Tags
client.tags.tag_contact(...)
#### 📝 Description
You can tag a specific contact. This will return a tag object for the tag that was added to the contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.tag_contact( contact_id="63a07ddf05a32042dffac965", tag_id="123", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**tag_id:** `str` — The unique identifier for the tag which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.untag_contact(...)
#### 📝 Description
You can remove tag from a specific contact. This will return a tag object for the tag that was removed from the contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.untag_contact( contact_id="63a07ddf05a32042dffac965", tag_id="7522907", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**tag_id:** `str` — The unique identifier for the tag which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.tag_conversation(...)
#### 📝 Description
You can tag a specific conversation. This will return a tag object for the tag that was added to the conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.tag_conversation( conversation_id="64619700005694", tag_id="7522907", admin_id="780", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — conversation_id
**tag_id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.untag_conversation(...)
#### 📝 Description
You can remove tag from a specific conversation. This will return a tag object for the tag that was removed from the conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.untag_conversation( conversation_id="64619700005694", tag_id="7522907", admin_id="123", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — conversation_id
**tag_id:** `str` — tag_id
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.list()
#### 📝 Description
You can fetch a list of all tags for a given workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.create(...)
#### 📝 Description
You can use this endpoint to perform the following operations: **1. Create a new tag:** You can create a new tag by passing in the tag name as specified in "Create or Update Tag Request Payload" described below. **2. Update an existing tag:** You can update an existing tag by passing the id of the tag as specified in "Create or Update Tag Request Payload" described below. **3. Tag Companies:** You can tag single company or a list of companies. You can tag a company by passing in the tag name and the company details as specified in "Tag Company Request Payload" described below. Also, if the tag doesn't exist then a new one will be created automatically. **4. Untag Companies:** You can untag a single company or a list of companies. You can untag a company by passing in the tag id and the company details as specified in "Untag Company Request Payload" described below. **5. Tag Multiple Users:** You can tag a list of users. You can tag the users by passing in the tag name and the user details as specified in "Tag Users Request Payload" described below. Each operation will return a tag object.
#### 🔌 Usage
```python from intercom import ( Intercom, TagMultipleUsersRequest, TagMultipleUsersRequestUsersItem, ) client = Intercom( token="YOUR_TOKEN", ) client.tags.create( request=TagMultipleUsersRequest( name="test", users=[ TagMultipleUsersRequestUsersItem( id="123", ) ], ), ) ```
#### ⚙️ Parameters
**request:** `TagsCreateRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.find(...)
#### 📝 Description
You can fetch the details of tags that are on the workspace by their id. This will return a tag object.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.find( tag_id="123", ) ```
#### ⚙️ Parameters
**tag_id:** `str` — The unique identifier of a given tag
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.delete(...)
#### 📝 Description
You can delete the details of tags that are on the workspace by passing in the id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.delete( tag_id="123", ) ```
#### ⚙️ Parameters
**tag_id:** `str` — The unique identifier of a given tag
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.tag_ticket(...)
#### 📝 Description
You can tag a specific ticket. This will return a tag object for the tag that was added to the ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.tag_ticket( ticket_id="64619700005694", tag_id="7522907", admin_id="780", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — ticket_id
**tag_id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tags.untag_ticket(...)
#### 📝 Description
You can remove tag from a specific ticket. This will return a tag object for the tag that was removed from the ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tags.untag_ticket( ticket_id="64619700005694", tag_id="7522907", admin_id="123", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — ticket_id
**tag_id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Conversations
client.conversations.list(...)
#### 📝 Description
You can fetch a list of all conversations. You can optionally request the result page size and the cursor to start after to fetch the result. {% 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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.conversations.list( per_page=1, starting_after="starting_after", ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**per_page:** `typing.Optional[int]` — How many results per page
**starting_after:** `typing.Optional[str]` — String used to get the next page of conversations.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.create(...)
#### 📝 Description
You can create a conversation that has been initiated by a contact (ie. user or lead). The conversation can be an in-app message only. {% admonition type="info" name="Sending for visitors" %} You can also send a message from a visitor by specifying their `user_id` or `id` value in the `from` field, along with a `type` field value of `contact`. This visitor will be automatically converted to a contact with a lead role once the conversation is created. {% /admonition %} This will return the Message model that has been created.
#### 🔌 Usage
```python from intercom import Intercom from intercom.conversations import CreateConversationRequestFrom client = Intercom( token="YOUR_TOKEN", ) client.conversations.create( from_=CreateConversationRequestFrom( type="user", id="123_doesnt_exist", ), body="Hello there", ) ```
#### ⚙️ Parameters
**from_:** `CreateConversationRequestFrom`
**body:** `str` — The content of the message. HTML is not supported.
**created_at:** `typing.Optional[int]` — The time the conversation was created as a UTC Unix timestamp. If not provided, the current time will be used. This field is only recommneded for migrating past conversations from another source into Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.find(...)
#### 📝 Description
You can fetch the details of a single conversation. This will return a single Conversation model with all its conversation parts. {% admonition type="warning" name="Hard limit of 500 parts" %} The maximum number of conversation parts that can be returned via the API is 500. If you have more than that we will return the 500 most recent conversation parts. {% /admonition %} For AI agent conversation metadata, please note that you need to have the agent enabled in your workspace, which is a [paid feature](https://www.intercom.com/help/en/articles/8205718-fin-resolutions#h_97f8c2e671).
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.find( conversation_id="123", display_as="plaintext", include_translations=True, ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The id of the conversation to target
**display_as:** `typing.Optional[str]` — Set to plaintext to retrieve conversation messages in plain text.
**include_translations:** `typing.Optional[bool]` — If set to true, conversation parts will be translated to the detected language of the conversation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.update(...)
#### 📝 Description
You can update an existing conversation. {% admonition type="info" name="Replying and other actions" %} If you want to reply to a coveration or take an action such as assign, unassign, open, close or snooze, take a look at the reply and manage endpoints. {% /admonition %} {% admonition type="info" %} This endpoint handles both **conversation updates** and **custom object associations**. See _`update a conversation with an association to a custom object instance`_ in the request/response examples to see the custom object association format. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.update( conversation_id="conversation_id", display_as="plaintext", read=True, title="new conversation title", custom_attributes={"issue_type": "Billing", "priority": "High"}, ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The id of the conversation to target
**display_as:** `typing.Optional[str]` — Set to plaintext to retrieve conversation messages in plain text.
**read:** `typing.Optional[bool]` — Mark a conversation as read within Intercom.
**title:** `typing.Optional[str]` — The title given to the conversation
**custom_attributes:** `typing.Optional[CustomAttributes]`
**company_id:** `typing.Optional[str]` — The ID of the company that the conversation is associated with. The unique identifier for the company which is given by Intercom. Set to nil to remove company.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.delete_conversation(...)
#### 📝 Description
You can delete a single conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.delete_conversation( conversation_id=1, ) ```
#### ⚙️ Parameters
**conversation_id:** `int` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.search(...)
#### 📝 Description
You can search for multiple conversations by the value of their attributes in order to fetch exactly which ones you want. To search for conversations, you need to send a `POST` request to `https://api.intercom.io/conversations/search`. This will accept a query object in the body which will define your filters in order to search for conversations. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is `20` results per page and maximum is `150`. See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiple's there can be: - There's a limit of max 2 nested filters - There's a limit of max 15 filters for each AND or OR group ### Accepted Fields Most keys listed in the conversation model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foorbar"`). The `source.body` field is unique as the search will not be performed against the entire value, but instead against every element of the value separately. For example, when searching for a conversation with a `"I need support"` body - the query should contain a `=` operator with the value `"support"` for such conversation to be returned. A query with a `=` operator and a `"need support"` value will not yield a result. | Field | Type | | :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | | id | String | | created_at | Date (UNIX timestamp) | | updated_at | Date (UNIX timestamp) | | source.type | String
Accepted fields are `conversation`, `email`, `facebook`, `instagram`, `phone_call`, `phone_switch`, `push`, `sms`, `twitter` and `whatsapp`. | | source.id | String | | source.delivered_as | String | | source.subject | String | | source.body | String | | source.author.id | String | | source.author.type | String | | source.author.name | String | | source.author.email | String | | source.url | String | | contact_ids | String | | teammate_ids | String | | admin_assignee_id | String | | team_assignee_id | String | | channel_initiated | String | | open | Boolean | | read | Boolean | | state | String | | waiting_since | Date (UNIX timestamp) | | snoozed_until | Date (UNIX timestamp) | | tag_ids | String | | priority | String | | statistics.time_to_assignment | Integer | | statistics.time_to_admin_reply | Integer | | statistics.time_to_first_close | Integer | | statistics.time_to_last_close | Integer | | statistics.median_time_to_reply | Integer | | statistics.first_contact_reply_at | Date (UNIX timestamp) | | statistics.first_assignment_at | Date (UNIX timestamp) | | statistics.first_admin_reply_at | Date (UNIX timestamp) | | statistics.first_close_at | Date (UNIX timestamp) | | statistics.last_assignment_at | Date (UNIX timestamp) | | statistics.last_assignment_admin_reply_at | Date (UNIX timestamp) | | statistics.last_contact_reply_at | Date (UNIX timestamp) | | statistics.last_admin_reply_at | Date (UNIX timestamp) | | statistics.last_close_at | Date (UNIX timestamp) | | statistics.last_closed_by_id | String | | statistics.count_reopens | Integer | | statistics.count_assignments | Integer | | statistics.count_conversation_parts | Integer | | conversation_rating.requested_at | Date (UNIX timestamp) | | conversation_rating.replied_at | Date (UNIX timestamp) | | conversation_rating.score | Integer | | conversation_rating.remark | String | | conversation_rating.contact_id | String | | conversation_rating.admin_d | String | | ai_agent_participated | Boolean | | ai_agent.resolution_state | String | | ai_agent.last_answer_type | String | | ai_agent.rating | Integer | | ai_agent.rating_remark | String | | ai_agent.source_type | String | | ai_agent.source_title | String | ### Accepted Operators The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :----------------------------- | :----------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In Shortcut for `OR` queries Values most be in Array | | NIN | All | Not In Shortcut for `OR !` queries Values must be in Array | | > | Integer Date (UNIX Timestamp) | Greater (or equal) than | | < | Integer Date (UNIX Timestamp) | Lower (or equal) than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import ( Intercom, MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) response = client.conversations.search( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.reply(...)
#### 📝 Description
You can reply to a conversation with a message from an admin or on behalf of a contact, or with a note for admins.
#### 🔌 Usage
```python from intercom import ContactReplyIntercomUserIdRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.reply( conversation_id='123 or "last"', request=ContactReplyIntercomUserIdRequest( body="Thanks again :)", intercom_user_id="6762f1571bb69f9f2193bbbb", ), ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The Intercom provisioned identifier for the conversation or the string "last" to reply to the last part of the conversation
**request:** `ReplyConversationRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.manage(...)
#### 📝 Description
For managing conversations you can: - Close a conversation - Snooze a conversation to reopen on a future date - Open a conversation which is `snoozed` or `closed` - Assign a conversation to an admin and/or team.
#### 🔌 Usage
```python from intercom import Intercom from intercom.conversations import ConversationsManageRequestBody_Close client = Intercom( token="YOUR_TOKEN", ) client.conversations.manage( conversation_id="123", request=ConversationsManageRequestBody_Close( admin_id="12345", ), ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The identifier for the conversation as given by Intercom.
**request:** `ConversationsManageRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.attach_contact_as_admin(...)
#### 📝 Description
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin. {% admonition type="warning" name="Contacts without an email" %} If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom from intercom.conversations import ( AttachContactToConversationRequestCustomerIntercomUserId, ) client = Intercom( token="YOUR_TOKEN", ) client.conversations.attach_contact_as_admin( conversation_id="123", admin_id="12345", customer=AttachContactToConversationRequestCustomerIntercomUserId( intercom_user_id="6762f19e1bb69f9f2193bbd5", ), ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The identifier for the conversation as given by Intercom.
**admin_id:** `typing.Optional[str]` — The `id` of the admin who is adding the new participant.
**customer:** `typing.Optional[AttachContactToConversationRequestCustomer]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.detach_contact_as_admin(...)
#### 📝 Description
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin. {% admonition type="warning" name="Contacts without an email" %} If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.detach_contact_as_admin( conversation_id="123", contact_id="123", admin_id="5017690", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The identifier for the conversation as given by Intercom.
**contact_id:** `str` — The identifier for the contact as given by Intercom.
**admin_id:** `str` — The `id` of the admin who is performing the action.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.redact_conversation_part(...)
#### 📝 Description
You can redact a conversation part or the source message of a conversation (as seen in the source object). {% admonition type="info" name="Redacting parts and messages" %} If you are redacting a conversation part, it must have a `body`. If you are redacting a source message, it must have been created by a contact. We will return a `conversation_part_not_redactable` error if these criteria are not met. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom, RedactConversationRequest_ConversationPart client = Intercom( token="YOUR_TOKEN", ) client.conversations.redact_conversation_part( request=RedactConversationRequest_ConversationPart( conversation_id="really_123_doesnt_exist", conversation_part_id="really_123_doesnt_exist", ), ) ```
#### ⚙️ Parameters
**request:** `RedactConversationRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.convert_to_ticket(...)
#### 📝 Description
You can convert a conversation to a ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.convert_to_ticket( conversation_id=1, ticket_type_id="54", ) ```
#### ⚙️ Parameters
**conversation_id:** `int` — The id of the conversation to target
**ticket_type_id:** `str` — The ID of the type of ticket you want to convert the conversation to
**attributes:** `typing.Optional[TicketRequestCustomAttributes]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.conversations.run_assignment_rules(...)
#### 📝 Description
{% admonition type="danger" name="Deprecation of Run Assignment Rules" %} Run assignment rules is now deprecated in version 2.12 and future versions and will be permanently removed on December 31, 2026. After this date, any requests made to this endpoint will fail. {% /admonition %} You can let a conversation be automatically assigned following assignment rules. {% admonition type="warning" name="When using workflows" %} It is not possible to use this endpoint with Workflows. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.conversations.run_assignment_rules( conversation_id="123", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The identifier for the conversation as given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Custom Channel Events
client.custom_channel_events.notify_new_conversation(...)
#### 📝 Description
Notifies Intercom that a new conversation was created in your custom channel/platform. This triggers conversation creation and workflow automations within Intercom for your custom channel integration. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import CustomChannelContact, Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_channel_events.notify_new_conversation( event_id="event_id", external_conversation_id="external_conversation_id", contact=CustomChannelContact( type="user", external_id="external_id", ), ) ```
#### ⚙️ Parameters
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_channel_events.notify_new_message(...)
#### 📝 Description
Notifies Intercom that a new message was sent in a conversation on your custom channel/platform. This allows Intercom to process the message and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import CustomChannelContact, Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_channel_events.notify_new_message( body="body", event_id="event_id", external_conversation_id="external_conversation_id", contact=CustomChannelContact( type="user", external_id="external_id", ), ) ```
#### ⚙️ Parameters
**body:** `str` — The message content sent by the user.
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_channel_events.notify_quick_reply_selected(...)
#### 📝 Description
Notifies Intercom that a user selected a quick reply option in your custom channel/platform. This allows Intercom to process the response and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import CustomChannelContact, Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_channel_events.notify_quick_reply_selected( event_id="evt_67890", external_conversation_id="conv_13579", contact=CustomChannelContact( type="user", external_id="user_003", name="Alice Example", email="alice@example.com", ), quick_reply_option_id="1234", ) ```
#### ⚙️ Parameters
**quick_reply_option_id:** `str` — Id of the selected quick reply option.
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_channel_events.notify_attribute_collected(...)
#### 📝 Description
Notifies Intercom that a user provided a response to an attribute collector in your custom channel/platform. This allows Intercom to process the attribute and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import CustomChannelAttribute, CustomChannelContact, Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_channel_events.notify_attribute_collected( attribute=CustomChannelAttribute( id="id", value="value", ), event_id="event_id", external_conversation_id="external_conversation_id", contact=CustomChannelContact( type="user", external_id="external_id", ), ) ```
#### ⚙️ Parameters
**attribute:** `CustomChannelAttribute`
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Custom Object Instances
client.custom_object_instances.get_custom_object_instances_by_external_id(...)
#### 📝 Description
Fetch a Custom Object Instance by external_id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_object_instances.get_custom_object_instances_by_external_id( custom_object_type_identifier="Order", external_id="external_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_object_instances.create_custom_object_instances(...)
#### 📝 Description
Create or update a custom object instance
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_object_instances.create_custom_object_instances( 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", }, ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `typing.Optional[str]` — A unique identifier for the Custom Object instance in the external system it originated from.
**external_created_at:** `typing.Optional[int]` — The time when the Custom Object instance was created in the external system it originated from.
**external_updated_at:** `typing.Optional[int]` — The time when the Custom Object instance was last updated in the external system it originated from.
**custom_attributes:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — The custom attributes which are set for the Custom Object instance.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_object_instances.delete_custom_object_instances_by_id(...)
#### 📝 Description
Delete a single Custom Object instance by external_id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_object_instances.delete_custom_object_instances_by_id( custom_object_type_identifier="Order", external_id="external_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_object_instances.get_custom_object_instances_by_id(...)
#### 📝 Description
Fetch a Custom Object Instance by id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_object_instances.get_custom_object_instances_by_id( custom_object_type_identifier="Order", custom_object_instance_id="custom_object_instance_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**custom_object_instance_id:** `str` — The id or external_id of the custom object instance
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.custom_object_instances.delete_custom_object_instances_by_external_id(...)
#### 📝 Description
Delete a single Custom Object instance using the Intercom defined id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.custom_object_instances.delete_custom_object_instances_by_external_id( custom_object_type_identifier="Order", custom_object_instance_id="custom_object_instance_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**custom_object_instance_id:** `str` — The Intercom defined id of the custom object instance
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Data Attributes
client.data_attributes.list(...)
#### 📝 Description
You can fetch a list of all data attributes belonging to a workspace for contacts, companies or conversations.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_attributes.list( model="contact", include_archived=True, ) ```
#### ⚙️ Parameters
**model:** `typing.Optional[DataAttributesListRequestModel]` — Specify the data attribute model to return.
**include_archived:** `typing.Optional[bool]` — Include archived attributes in the list. By default we return only non archived data attributes.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_attributes.create(...)
#### 📝 Description
You can create a data attributes for a `contact` or a `company`.
#### 🔌 Usage
```python from intercom import ( CreateDataAttributeRequestOptions, CreateDataAttributeRequestOptionsOptionsItem, Intercom, ) client = Intercom( token="YOUR_TOKEN", ) client.data_attributes.create( request=CreateDataAttributeRequestOptions( options=[ CreateDataAttributeRequestOptionsOptionsItem( value="1-10", ) ], ), ) ```
#### ⚙️ Parameters
**request:** `CreateDataAttributeRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.data_attributes.update(...)
#### 📝 Description
You can update a data attribute. > 🚧 Updating the data type is not possible > > It is currently a dangerous action to execute changing a data attribute's type via the API. You will need to update the type via the UI instead.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.data_attributes.update( data_attribute_id=1, request={"description": "Trying to archieve", "archived": True}, ) ```
#### ⚙️ Parameters
**data_attribute_id:** `int` — The data attribute id
**request:** `UpdateDataAttributeRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Events
client.events.list(...)
#### 📝 Description
> 🚧 > > Please note that you can only 'list' events that are less than 90 days old. Event counts and summaries will still include your events older than 90 days but you cannot 'list' these events individually if they are older than 90 days The events belonging to a customer can be listed by sending a GET request to `https://api.intercom.io/events` with a user or lead identifier along with a `type` parameter. The identifier parameter can be one of `user_id`, `email` or `intercom_user_id`. The `type` parameter value must be `user`. - `https://api.intercom.io/events?type=user&user_id={user_id}` - `https://api.intercom.io/events?type=user&email={email}` - `https://api.intercom.io/events?type=user&intercom_user_id={id}` (this call can be used to list leads) The `email` parameter value should be [url encoded](http://en.wikipedia.org/wiki/Percent-encoding) when sending. You can optionally define the result page size as well with the `per_page` parameter.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.events.list( user_id="user_id", intercom_user_id="intercom_user_id", email="email", type="type", summary=True, per_page=1, ) ```
#### ⚙️ Parameters
**type:** `str` — The value must be user
**user_id:** `typing.Optional[str]` — user_id query parameter
**intercom_user_id:** `typing.Optional[str]` — intercom_user_id query parameter
**email:** `typing.Optional[str]` — email query parameter
**summary:** `typing.Optional[bool]` — summary flag
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.events.create(...)
#### 📝 Description
You will need an Access Token that has write permissions to send Events. Once you have a key you can submit events via POST to the Events resource, which is located at https://api.intercom.io/events, or you can send events using one of the client libraries. When working with the HTTP API directly a client should send the event with a `Content-Type` of `application/json`. When using the JavaScript API, [adding the code to your app](http://docs.intercom.io/configuring-Intercom/tracking-user-events-in-your-app) makes the Events API available. Once added, you can submit an event using the `trackEvent` method. This will associate the event with the Lead or currently logged-in user or logged-out visitor/lead and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event. With the Ruby client you pass a hash describing the event to `Intercom::Event.create`, or call the `track_user` method directly on the current user object (e.g. `user.track_event`). **NB: For the JSON object types, please note that we do not currently support nested JSON structure.** | Type | Description | Example | | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | | String | The value is a JSON String | `"source":"desktop"` | | Number | The value is a JSON Number | `"load": 3.67` | | Date | The key ends with the String `_date` and the value is a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time), assumed to be in the [UTC](http://en.wikipedia.org/wiki/Coordinated_Universal_Time) timezone. | `"contact_date": 1392036272` | | Link | The value is a HTTP or HTTPS URI. | `"article": "https://example.org/ab1de.html"` | | Rich Link | The value is a JSON object that contains `url` and `value` keys. | `"article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}` | | Monetary Amount | The value is a JSON object that contains `amount` and `currency` keys. The `amount` key is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99. | `"price": {"amount": 34999, "currency": "eur"}` | **Lead Events** When submitting events for Leads, you will need to specify the Lead's `id`. **Metadata behaviour** - We currently limit the number of tracked metadata keys to 10 per event. Once the quota is reached, we ignore any further keys we receive. The first 10 metadata keys are determined by the order in which they are sent in with the event. - It is not possible to change the metadata keys once the event has been sent. A new event will need to be created with the new keys and you can archive the old one. - There might be up to 24 hrs delay when you send a new metadata for an existing event. **Event de-duplication** The API may detect and ignore duplicate events. Each event is uniquely identified as a combination of the following data - the Workspace identifier, the Contact external identifier, the Data Event name and the Data Event created time. As a result, it is **strongly recommended** to send a second granularity Unix timestamp in the `created_at` field. Duplicated events are responded to using the normal `202 Accepted` code - an error is not thrown, however repeat requests will be counted against any rate limit that is in place. ### HTTP API Responses - Successful responses to submitted events return `202 Accepted` with an empty body. - Unauthorised access will be rejected with a `401 Unauthorized` or `403 Forbidden` response code. - Events sent about users that cannot be found will return a `404 Not Found`. - Event lists containing duplicate events will have those duplicates ignored. - Server errors will return a `500` response code and may contain an error message in the body.
#### 🔌 Usage
```python from intercom import CreateDataEventRequestWithId, Intercom client = Intercom( token="YOUR_TOKEN", ) client.events.create( request=CreateDataEventRequestWithId( id="8a88a590-e1c3-41e2-a502-e0649dbf721c", event_name="invited-friend", created_at=1671028894, ), ) ```
#### ⚙️ Parameters
**request:** `CreateDataEventRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.events.summaries(...)
#### 📝 Description
Create event summaries for a user. Event summaries are used to track the number of times an event has occurred, the first time it occurred and the last time it occurred.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.events.summaries() ```
#### ⚙️ Parameters
**user_id:** `typing.Optional[str]` — Your identifier for the user.
**event_summaries:** `typing.Optional[CreateDataEventSummariesRequestEventSummaries]` — A list of event summaries for the user. Each event summary should contain the event name, the time the event occurred, and the number of times the event occurred. The event name should be a past tense 'verb-noun' combination, to improve readability, for example `updated-plan`.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Jobs
client.jobs.status(...)
#### 📝 Description
Retrieve the status of job execution.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.jobs.status( job_id="job_id", ) ```
#### ⚙️ Parameters
**job_id:** `str` — The unique identifier for the job which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Messages
client.messages.create(...)
#### 📝 Description
You can create a message that has been initiated by an admin. The conversation can be either an in-app message or an email. > 🚧 Sending for visitors > > There can be a short delay between when a contact is created and when a contact becomes available to be messaged through the API. A 404 Not Found error will be returned in this case. This will return the Message model that has been created. > 🚧 Retrieving Associated Conversations > > As this is a message, there will be no conversation present until the contact responds. Once they do, you will have to search for a contact's conversations with the id of the message.
#### 🔌 Usage
```python from intercom import ( CreateMessageRequest_Email, CreateMessageRequestFrom, CreateMessageRequestTo, Intercom, ) client = Intercom( token="YOUR_TOKEN", ) client.messages.create( request=CreateMessageRequest_Email( subject="Thanks for everything", body="Hello there", template="plain", from_=CreateMessageRequestFrom( id=394051, ), to=CreateMessageRequestTo( type="user", id="536e564f316c83104c000020", ), ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateMessageRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Segments
client.segments.list(...)
#### 📝 Description
You can fetch a list of all segments.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.segments.list( include_count=True, ) ```
#### ⚙️ Parameters
**include_count:** `typing.Optional[bool]` — It includes the count of contacts that belong to each segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.segments.find(...)
#### 📝 Description
You can fetch the details of a single segment.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.segments.find( segment_id="123", ) ```
#### ⚙️ Parameters
**segment_id:** `str` — The unique identified of a given segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Subscription Types
client.subscription_types.list()
#### 📝 Description
You can list all subscription types. A list of subscription type objects will be returned.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.subscription_types.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## PhoneCallRedirects
client.phone_call_redirects.create(...)
#### 📝 Description
You can use the API to deflect phone calls to the Intercom Messenger. Calling this endpoint will send an SMS with a link to the Messenger to the phone number specified. If custom attributes are specified, they will be added to the user or lead's custom data attributes.
#### 🔌 Usage
```python from intercom import CreatePhoneSwitchRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.phone_call_redirects.create( request=CreatePhoneSwitchRequest( phone="+40241100100", custom_attributes={"issue_type": "Billing", "priority": "High"}, ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreatePhoneSwitchRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Calls
client.calls.list_calls(...)
#### 📝 Description
Retrieve a paginated list of calls.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.calls.list_calls( page=1, per_page=1, ) ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 25. Max 25.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.calls.show_call(...)
#### 📝 Description
Retrieve a single call by id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.calls.show_call( call_id="call_id", ) ```
#### ⚙️ Parameters
**call_id:** `str` — The id of the call to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.calls.show_call_recording(...)
#### 📝 Description
Redirects to a signed URL for the call's recording if it exists.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.calls.show_call_recording( call_id="call_id", ) ```
#### ⚙️ Parameters
**call_id:** `str` — The id of the call
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.calls.show_call_transcript(...)
#### 📝 Description
Returns the transcript for the specified call as a downloadable text file.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.calls.show_call_transcript( call_id="call_id", ) ```
#### ⚙️ Parameters
**call_id:** `str` — The id of the call
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.calls.list_calls_with_transcripts(...)
#### 📝 Description
Retrieve calls by a list of conversation ids and include transcripts when available. A maximum of 20 `conversation_ids` can be provided. If none are provided or more than 20 are provided, a 400 error is returned.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.calls.list_calls_with_transcripts( conversation_ids=["64619700005694", "64619700005695"], ) ```
#### ⚙️ Parameters
**conversation_ids:** `typing.Sequence[str]` — A list of conversation ids to fetch calls for. Maximum 20.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Teams
client.teams.list()
#### 📝 Description
This will return a list of team objects for the App.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.teams.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.teams.find(...)
#### 📝 Description
You can fetch the details of a single team, containing an array of admins that belong to this team.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.teams.find( team_id="123", ) ```
#### ⚙️ Parameters
**team_id:** `str` — The unique identifier of a given team.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Ticket States
client.ticket_states.list_ticket_states()
#### 📝 Description
You can get a list of all ticket states for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_states.list_ticket_states() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Ticket Types
client.ticket_types.list()
#### 📝 Description
You can get a list of all ticket types for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ticket_types.create(...)
#### 📝 Description
You can create a new ticket type. > 📘 Creating ticket types. > > Every ticket type will be created with two default attributes: _default_title_ and _default_description_. > For the `icon` propery, use an emoji from [Twemoji Cheatsheet](https://twemoji-cheatsheet.vercel.app/)
#### 🔌 Usage
```python from intercom import CreateTicketTypeRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.create( request=CreateTicketTypeRequest( name="Customer Issue", description="Customer Report Template", category="Customer", icon="🎟️", ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateTicketTypeRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ticket_types.get(...)
#### 📝 Description
You can fetch the details of a single ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.get( ticket_type_id="ticket_type_id", ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ticket_types.update(...)
#### 📝 Description
You can update a ticket type. > 📘 Updating a ticket type. > > For the `icon` propery, use an emoji from [Twemoji Cheatsheet](https://twemoji-cheatsheet.vercel.app/)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.update( ticket_type_id="ticket_type_id", name="Bug Report 2", ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**name:** `typing.Optional[str]` — The name of the ticket type.
**description:** `typing.Optional[str]` — The description of the ticket type.
**category:** `typing.Optional[UpdateTicketTypeRequestCategory]` — Category of the Ticket Type.
**icon:** `typing.Optional[str]` — The icon of the ticket type.
**archived:** `typing.Optional[bool]` — The archived status of the ticket type.
**is_internal:** `typing.Optional[bool]` — Whether the tickets associated with this ticket type are intended for internal use only or will be shared with customers. This is currently a limited attribute.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Tickets
client.tickets.reply(...)
#### 📝 Description
You can reply to a ticket with a message from an admin or on behalf of a contact, or with a note for admins.
#### 🔌 Usage
```python from intercom import ContactReplyTicketIntercomUserIdRequest, Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.reply( ticket_id="123", request=ContactReplyTicketIntercomUserIdRequest( body="Thanks again :)", intercom_user_id="6762f2971bb69f9f2193bc49", ), ) ```
#### ⚙️ Parameters
**ticket_id:** `str`
**request:** `TicketsReplyRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.create(...)
#### 📝 Description
You can create a new ticket.
#### 🔌 Usage
```python from intercom import CreateTicketRequestContactsItemId, Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.create( ticket_type_id="1234", contacts=[ CreateTicketRequestContactsItemId( id="6762f2d81bb69f9f2193bc54", ) ], ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The ID of the type of ticket you want to create
**contacts:** `typing.Sequence[CreateTicketRequestContactsItem]` — The list of contacts (users or leads) affected by this ticket. Currently only one is allowed
**skip_notifications:** `typing.Optional[bool]` — Option to disable notifications when a Ticket is created.
**conversation_to_link_id:** `typing.Optional[str]` The ID of the conversation you want to link to the ticket. Here are the valid ways of linking two tickets: - conversation | back-office ticket - customer tickets | non-shared back-office ticket - conversation | tracker ticket - customer ticket | tracker ticket
**company_id:** `typing.Optional[str]` — The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom
**created_at:** `typing.Optional[int]` — The time the ticket was created. If not provided, the current time will be used.
**assignment:** `typing.Optional[CreateTicketRequestAssignment]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.enqueue_create_ticket(...)
#### 📝 Description
Enqueues ticket creation for asynchronous processing, returning if the job was enqueued successfully to be processed. We attempt to perform a best-effort validation on inputs before tasks are enqueued. If the given parameters are incorrect, we won't enqueue the job.
#### 🔌 Usage
```python from intercom import CreateTicketRequestContactsItemId, Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.enqueue_create_ticket( ticket_type_id="1234", contacts=[ CreateTicketRequestContactsItemId( id="6762f2d81bb69f9f2193bc54", ) ], ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The ID of the type of ticket you want to create
**contacts:** `typing.Sequence[CreateTicketRequestContactsItem]` — The list of contacts (users or leads) affected by this ticket. Currently only one is allowed
**skip_notifications:** `typing.Optional[bool]` — Option to disable notifications when a Ticket is created.
**conversation_to_link_id:** `typing.Optional[str]` The ID of the conversation you want to link to the ticket. Here are the valid ways of linking two tickets: - conversation | back-office ticket - customer tickets | non-shared back-office ticket - conversation | tracker ticket - customer ticket | tracker ticket
**company_id:** `typing.Optional[str]` — The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom
**created_at:** `typing.Optional[int]` — The time the ticket was created. If not provided, the current time will be used.
**assignment:** `typing.Optional[CreateTicketRequestAssignment]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.get(...)
#### 📝 Description
You can fetch the details of a single ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.get( ticket_id="ticket_id", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — The unique identifier for the ticket which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.update(...)
#### 📝 Description
You can update a ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.update( ticket_id="ticket_id", ticket_state_id="123", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — The unique identifier for the ticket which is given by Intercom
**ticket_attributes:** `typing.Optional[typing.Dict[str, typing.Any]]` — The attributes set on the ticket.
**ticket_state_id:** `typing.Optional[str]` — The ID of the ticket state associated with the ticket type.
**company_id:** `typing.Optional[str]` — The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom. Set to nil to remove company.
**open:** `typing.Optional[bool]` — Specify if a ticket is open. Set to false to close a ticket. Closing a ticket will also unsnooze it.
**is_shared:** `typing.Optional[bool]` — Specify whether the ticket is visible to users.
**snoozed_until:** `typing.Optional[int]` — The time you want the ticket to reopen.
**admin_id:** `typing.Optional[int]` — The ID of the admin performing ticket update. Needed for workflows execution and attributing actions to specific admins.
**assignee_id:** `typing.Optional[str]` — The ID of the admin or team to which the ticket is assigned. Set this 0 to unassign it.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.delete_ticket(...)
#### 📝 Description
You can delete a ticket using the Intercom provided ID.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.tickets.delete_ticket( ticket_id="ticket_id", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — The unique identifier for the ticket which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.tickets.search(...)
#### 📝 Description
You can search for multiple tickets by the value of their attributes in order to fetch exactly which ones you want. To search for tickets, you send a `POST` request to `https://api.intercom.io/tickets/search`. This will accept a query object in the body which will define your filters. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize 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/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiples there can be: - There's a limit of max 2 nested filters - There's a limit of max 15 filters for each AND or OR group ### Accepted Fields Most keys listed as part of the Ticket model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foobar"`). The `source.body` field is unique as the search will not be performed against the entire value, but instead against every element of the value separately. For example, when searching for a conversation with a `"I need support"` body - the query should contain a `=` operator with the value `"support"` for such conversation to be returned. A query with a `=` operator and a `"need support"` value will not yield a result. | Field | Type | | :---------------------------------------- | :--------------------------------------------------------------------------------------- | | id | String | | created_at | Date (UNIX timestamp) | | updated_at | Date (UNIX timestamp) | | title | String | | description | String | | category | String | | ticket_type_id | String | | contact_ids | String | | teammate_ids | String | | admin_assignee_id | String | | team_assignee_id | String | | open | Boolean | | state | String | | snoozed_until | Date (UNIX timestamp) | | ticket_attribute.{id} | String or Boolean or Date (UNIX timestamp) or Float or Integer | {% admonition type="info" name="Searching by Category" %} When searching for tickets by the **`category`** field, specific terms must be used instead of the category names: * For **Customer** category tickets, use the term `request`. * For **Back-office** category tickets, use the term `task`. * For **Tracker** category tickets, use the term `tracker`. {% /admonition %} ### Accepted Operators {% admonition type="info" name="Searching based on `created_at`" %} You may use the `<=` or `>=` operators to search by `created_at`. {% /admonition %} The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :----------------------------- | :----------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In Shortcut for `OR` queries Values most be in Array | | NIN | All | Not In Shortcut for `OR !` queries Values must be in Array | | > | Integer Date (UNIX Timestamp) | Greater (or equal) than | | < | Integer Date (UNIX Timestamp) | Lower (or equal) than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import ( Intercom, MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) response = client.tickets.search( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Visitors
client.visitors.find(...)
#### 📝 Description
You can fetch the details of a single visitor.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.visitors.find( user_id="user_id", ) ```
#### ⚙️ Parameters
**user_id:** `str` — The user_id of the Visitor you want to retrieve.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.visitors.update(...)
#### 📝 Description
Sending a PUT request to `/visitors` will result in an update of an existing Visitor. **Option 1.** You can update a visitor by passing in the `user_id` of the visitor in the Request body. **Option 2.** You can update a visitor by passing in the `id` of the visitor in the Request body.
#### 🔌 Usage
```python from intercom import Intercom, UpdateVisitorRequestWithUserId client = Intercom( token="YOUR_TOKEN", ) client.visitors.update( request=UpdateVisitorRequestWithUserId( user_id="fail", name="Christian Fail", ), ) ```
#### ⚙️ Parameters
**request:** `UpdateVisitorRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.visitors.merge_to_contact(...)
#### 📝 Description
You can merge a Visitor to a Contact of role type `lead` or `user`. > 📘 What happens upon a visitor being converted? > > If the User exists, then the Visitor will be merged into it, the Visitor deleted and the User returned. If the User does not exist, the Visitor will be converted to a User, with the User identifiers replacing it's Visitor identifiers.
#### 🔌 Usage
```python from intercom import Intercom from intercom.visitors import UserWithId, VisitorWithUserId client = Intercom( token="YOUR_TOKEN", ) client.visitors.merge_to_contact( type="user", user=UserWithId( id="8a88a590-e1c3-41e2-a502-e0649dbf721c", email="foo@bar.com", ), visitor=VisitorWithUserId( user_id="3ecf64d0-9ed1-4e9f-88e1-da7d6e6782f3", ), ) ```
#### ⚙️ Parameters
**type:** `str` — Represents the role of the Contact model. Accepts `lead` or `user`.
**user:** `ConvertVisitorRequestUser` — The unique identifiers retained after converting or merging.
**visitor:** `ConvertVisitorRequestVisitor` — The unique identifiers to convert a single Visitor.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## HelpCenters Collections
client.help_centers.collections.list(...)
#### 📝 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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) response = client.help_centers.collections.list() for item in response: yield item # alternatively, you can paginate page-by-page for page in response.iter_pages(): yield page ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.help_centers.collections.create(...)
#### 📝 Description
You can create a new collection by making a POST request to `https://api.intercom.io/help_center/collections.`
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.help_centers.collections.create( name="collection 51", description="Missing required parameter", ) ```
#### ⚙️ Parameters
**name:** `str` — The name of the collection. For multilingual collections, this will be the name of the default language's content.
**description:** `typing.Optional[str]` — The description of the collection. For multilingual collections, this will be the description of the default language's content.
**translated_content:** `typing.Optional[GroupTranslatedContent]`
**parent_id:** `typing.Optional[str]` — The id of the parent collection. If `null` then it will be created as the first level collection.
**help_center_id:** `typing.Optional[int]` — The id of the help center where the collection will be created. If `null` then it will be created in the default help center.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.help_centers.collections.find(...)
#### 📝 Description
You can fetch the details of a single collection by making a GET request to `https://api.intercom.io/help_center/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.help_centers.collections.find( collection_id=1, ) ```
#### ⚙️ Parameters
**collection_id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.help_centers.collections.update(...)
#### 📝 Description
You can update the details of a single collection by making a PUT request to `https://api.intercom.io/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.help_centers.collections.update( collection_id=1, name="Update collection name", ) ```
#### ⚙️ Parameters
**collection_id:** `int` — The unique identifier for the collection which is given by Intercom.
**name:** `typing.Optional[str]` — The name of the collection. For multilingual collections, this will be the name of the default language's content.
**description:** `typing.Optional[str]` — The description of the collection. For multilingual collections, this will be the description of the default language's content.
**translated_content:** `typing.Optional[GroupTranslatedContent]`
**parent_id:** `typing.Optional[str]` — The id of the parent collection. If `null` then it will be updated as the first level collection.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.help_centers.collections.delete(...)
#### 📝 Description
You can delete a single collection by making a DELETE request to `https://api.intercom.io/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.help_centers.collections.delete( collection_id=1, ) ```
#### ⚙️ Parameters
**collection_id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## News Items
client.news.items.list()
#### 📝 Description
You can fetch a list of all news items
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.items.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.items.create(...)
#### 📝 Description
You can create a news item
#### 🔌 Usage
```python from intercom import Intercom from intercom.news import NewsfeedAssignment client = Intercom( token="YOUR_TOKEN", ) client.news.items.create( title="Halloween is here!", body="

New costumes in store for this spooky season

", sender_id=991267834, state="live", deliver_silently=True, labels=["Product", "Update", "New"], reactions=["😆", "😅"], newsfeed_assignments=[ NewsfeedAssignment( newsfeed_id=53, published_at=1664638214, ) ], ) ```
#### ⚙️ Parameters
**title:** `str` — The title of the news item.
**sender_id:** `int` — The id of the sender of the news item. Must be a teammate on the workspace.
**body:** `typing.Optional[str]` — The news item body, which may contain HTML.
**state:** `typing.Optional[NewsItemRequestState]` — News items will not be visible to your users in the assigned newsfeeds until they are set live.
**deliver_silently:** `typing.Optional[bool]` — When set to `true`, the news item will appear in the messenger newsfeed without showing a notification badge.
**labels:** `typing.Optional[typing.Sequence[str]]` — Label names displayed to users to categorize the news item.
**reactions:** `typing.Optional[typing.Sequence[typing.Optional[str]]]` — Ordered list of emoji reactions to the news item. When empty, reactions are disabled.
**newsfeed_assignments:** `typing.Optional[typing.Sequence[NewsfeedAssignment]]` — A list of newsfeed_assignments to assign to the specified newsfeed.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.items.find(...)
#### 📝 Description
You can fetch the details of a single news item.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.items.find( news_item_id=1, ) ```
#### ⚙️ Parameters
**news_item_id:** `int` — The unique identifier for the news item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.items.update(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.items.update( news_item_id=1, title="Christmas is here!", body="

New gifts in store for the jolly season

", sender_id=991267848, reactions=["😝", "😂"], ) ```
#### ⚙️ Parameters
**news_item_id:** `int` — The unique identifier for the news item which is given by Intercom.
**title:** `str` — The title of the news item.
**sender_id:** `int` — The id of the sender of the news item. Must be a teammate on the workspace.
**body:** `typing.Optional[str]` — The news item body, which may contain HTML.
**state:** `typing.Optional[NewsItemRequestState]` — News items will not be visible to your users in the assigned newsfeeds until they are set live.
**deliver_silently:** `typing.Optional[bool]` — When set to `true`, the news item will appear in the messenger newsfeed without showing a notification badge.
**labels:** `typing.Optional[typing.Sequence[str]]` — Label names displayed to users to categorize the news item.
**reactions:** `typing.Optional[typing.Sequence[typing.Optional[str]]]` — Ordered list of emoji reactions to the news item. When empty, reactions are disabled.
**newsfeed_assignments:** `typing.Optional[typing.Sequence[NewsfeedAssignment]]` — A list of newsfeed_assignments to assign to the specified newsfeed.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.items.delete(...)
#### 📝 Description
You can delete a single news item.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.items.delete( news_item_id=1, ) ```
#### ⚙️ Parameters
**news_item_id:** `int` — The unique identifier for the news item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## News Feeds
client.news.feeds.list_items(...)
#### 📝 Description
You can fetch a list of all news items that are live on a given newsfeed
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.feeds.list_items( newsfeed_id="123", ) ```
#### ⚙️ Parameters
**newsfeed_id:** `str` — The unique identifier for the news feed item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.feeds.list()
#### 📝 Description
You can fetch a list of all newsfeeds
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.feeds.list() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.news.feeds.find(...)
#### 📝 Description
You can fetch the details of a single newsfeed
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.news.feeds.find( newsfeed_id="123", ) ```
#### ⚙️ Parameters
**newsfeed_id:** `str` — The unique identifier for the news feed item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## TicketTypes Attributes
client.ticket_types.attributes.create(...)
#### 📝 Description
You can create a new attribute for a ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.attributes.create( ticket_type_id="ticket_type_id", name="Attribute Title", description="Attribute Description", data_type="string", required_to_create=False, ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**name:** `str` — The name of the ticket type attribute
**description:** `str` — The description of the attribute presented to the teammate or contact
**data_type:** `CreateTicketTypeAttributeRequestDataType` — The data type of the attribute
**required_to_create:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when teammates are creating the ticket in Inbox.
**required_to_create_for_contacts:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when contacts are creating the ticket in Messenger.
**visible_on_create:** `typing.Optional[bool]` — Whether the attribute is visible to teammates when creating a ticket in Inbox.
**visible_to_contacts:** `typing.Optional[bool]` — Whether the attribute is visible to contacts when creating a ticket in Messenger.
**multiline:** `typing.Optional[bool]` — Whether the attribute allows multiple lines of text (only applicable to string attributes)
**list_items:** `typing.Optional[str]` — A comma delimited list of items for the attribute value (only applicable to list attributes)
**allow_multiple_values:** `typing.Optional[bool]` — Whether the attribute allows multiple files to be attached to it (only applicable to file attributes)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.ticket_types.attributes.update(...)
#### 📝 Description
You can update an existing attribute for a ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.ticket_types.attributes.update( ticket_type_id="ticket_type_id", attribute_id="attribute_id", description="New Attribute Description", ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**attribute_id:** `str` — The unique identifier for the ticket type attribute which is given by Intercom.
**name:** `typing.Optional[str]` — The name of the ticket type attribute
**description:** `typing.Optional[str]` — The description of the attribute presented to the teammate or contact
**required_to_create:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when teammates are creating the ticket in Inbox.
**required_to_create_for_contacts:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when contacts are creating the ticket in Messenger.
**visible_on_create:** `typing.Optional[bool]` — Whether the attribute is visible to teammates when creating a ticket in Inbox.
**visible_to_contacts:** `typing.Optional[bool]` — Whether the attribute is visible to contacts when creating a ticket in Messenger.
**multiline:** `typing.Optional[bool]` — Whether the attribute allows multiple lines of text (only applicable to string attributes)
**list_items:** `typing.Optional[str]` — A comma delimited list of items for the attribute value (only applicable to list attributes)
**allow_multiple_values:** `typing.Optional[bool]` — Whether the attribute allows multiple files to be attached to it (only applicable to file attributes)
**archived:** `typing.Optional[bool]` — Whether the attribute should be archived and not shown during creation of the ticket (it will still be present on previously created tickets)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Admins
client.unstable.admins.identify_admin()
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.admins.identify_admin() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.admins.set_away_admin(...)
#### 📝 Description
You can set an Admin as away for the Inbox.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.admins.set_away_admin( id=1, away_mode_enabled=True, away_mode_reassign=True, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier of a given admin
**away_mode_enabled:** `bool` — Set to "true" to change the status of the admin to away.
**away_mode_reassign:** `bool` — Set to "true" to assign any new conversation replies to your default inbox.
**away_status_reason_id:** `typing.Optional[int]` — The unique identifier of the away status reason
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.admins.list_activity_logs(...)
#### 📝 Description
You can get a log of activities by all admins in an app.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.admins.list_activity_logs( created_at_after="1677253093", created_at_before="1677861493", ) ```
#### ⚙️ Parameters
**created_at_after:** `str` — The start date that you request data for. It must be formatted as a UNIX timestamp.
**created_at_before:** `typing.Optional[str]` — The end date that you request data for. It must be formatted as a UNIX timestamp.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.admins.list_admins()
#### 📝 Description
You can fetch a list of admins for a given workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.admins.list_admins() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.admins.retrieve_admin(...)
#### 📝 Description
You can retrieve the details of a single admin.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.admins.retrieve_admin( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier of a given admin
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## AI Content
client.unstable.ai_content.list_content_import_sources()
#### 📝 Description
You can retrieve a list of all content import sources for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.list_content_import_sources() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.create_content_import_source(...)
#### 📝 Description
You can create a new content import source by sending a POST request to this endpoint.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.create_content_import_source( url="https://www.example.com", ) ```
#### ⚙️ Parameters
**url:** `str` — The URL of the content import source.
**status:** `typing.Optional[CreateContentImportSourceRequestStatus]` — The status of the content import source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.get_content_import_source(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.get_content_import_source( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the content import source which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.update_content_import_source(...)
#### 📝 Description
You can update an existing content import source.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.update_content_import_source( id="id", sync_behavior="api", url="https://www.example.com", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the content import source which is given by Intercom.
**sync_behavior:** `UpdateContentImportSourceRequestSyncBehavior` — If you intend to create or update External Pages via the API, this should be set to `api`. You can not change the value to or from api.
**url:** `str` — The URL of the content import source. This may only be different from the existing value if the sync behavior is API.
**status:** `typing.Optional[UpdateContentImportSourceRequestStatus]` — The status of the content import source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.delete_content_import_source(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.delete_content_import_source( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the content import source which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.list_external_pages()
#### 📝 Description
You can retrieve a list of all external pages for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.list_external_pages() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.create_external_page(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.create_external_page( title="Test", html="

Test

", url="https://www.example.com", source_id=44, external_id="abc1234", ) ```
#### ⚙️ Parameters
**title:** `str` — The title of the external page.
**html:** `str` — The body of the external page in HTML.
**source_id:** `int` — The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
**external_id:** `str` — The identifier for the external page which was given by the source. Must be unique for the source.
**url:** `typing.Optional[str]` — The URL of the external page. This will be used by Fin to link end users to the page it based its answer on. When a URL is not present, Fin will not reference the source.
**ai_agent_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by AI Agent. Will not default when updating an existing external page.
**ai_copilot_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by AI Copilot. Will not default when updating an existing external page.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.get_external_page(...)
#### 📝 Description
You can retrieve an external page.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.get_external_page( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the external page which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.update_external_page(...)
#### 📝 Description
You can update an existing external page (if it was created via the API).
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.update_external_page( id="id", title="Test", html="

Test

", url="https://www.example.com", source_id=47, external_id="5678", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the external page which is given by Intercom.
**title:** `str` — The title of the external page.
**html:** `str` — The body of the external page in HTML.
**url:** `str` — The URL of the external page. This will be used by Fin to link end users to the page it based its answer on.
**source_id:** `int` — The unique identifier for the source of the external page which was given by Intercom. Every external page must be associated with a Content Import Source which represents the place it comes from and from which it inherits a default audience (configured in the UI). For a new source, make a POST request to the Content Import Source endpoint and an ID for the source will be returned in the response.
**fin_availability:** `typing.Optional[bool]` — Whether the external page should be used to answer questions by Fin.
**external_id:** `typing.Optional[str]` — The identifier for the external page which was given by the source. Must be unique for the source.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ai_content.delete_external_page(...)
#### 📝 Description
Sending a DELETE request for an external page will remove it from the content library UI and from being used for AI answers.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ai_content.delete_external_page( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the external page which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Articles
client.unstable.articles.list_articles()
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.articles.list_articles() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.articles.create_article(...)
#### 📝 Description
You can create a new article by making a POST request to `https://api.intercom.io/articles`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.articles.create_article( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.articles.retrieve_article(...)
#### 📝 Description
You can fetch the details of a single article by making a GET request to `https://api.intercom.io/articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.articles.retrieve_article( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.articles.delete_article(...)
#### 📝 Description
You can delete a single article by making a DELETE request to `https://api.intercom.io/articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.articles.delete_article( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.articles.search_articles(...)
#### 📝 Description
You can search for articles by making a GET request to `https://api.intercom.io/articles/search`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.articles.search_articles( phrase="Getting started", state="published", help_center_id=1, highlight=True, ) ```
#### ⚙️ Parameters
**phrase:** `typing.Optional[str]` — The phrase within your articles to search for.
**state:** `typing.Optional[str]` — The state of the Articles returned. One of `published`, `draft` or `all`.
**help_center_id:** `typing.Optional[int]` — The ID of the Help Center to search in.
**highlight:** `typing.Optional[bool]` — Return a highlighted version of the matching content within your articles. Refer to the response schema for more details.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Away Status Reasons
client.unstable.away_status_reasons.list_away_status_reasons()
#### 📝 Description
Returns a list of all away status reasons configured for the workspace, including deleted ones.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.away_status_reasons.list_away_status_reasons() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Unstable Export
client.unstable.export.enqueue_a_new_reporting_data_export_job(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.export.enqueue_a_new_reporting_data_export_job( dataset_id="conversation", attribute_ids=["conversation_id", "conversation_started_at"], start_time=1717490000, end_time=1717510000, ) ```
#### ⚙️ Parameters
**dataset_id:** `str`
**attribute_ids:** `typing.Sequence[str]`
**start_time:** `int`
**end_time:** `int`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.export.list_available_datasets_and_attributes()
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.export.list_available_datasets_and_attributes() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Help Center
client.unstable.help_center.list_all_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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.list_all_collections() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.create_collection(...)
#### 📝 Description
You can create a new collection by making a POST request to `https://api.intercom.io/help_center/collections.`
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.create_collection( name="collection 51", description="Missing required parameter", ) ```
#### ⚙️ Parameters
**name:** `str` — The name of the collection. For multilingual collections, this will be the name of the default language's content.
**description:** `typing.Optional[str]` — The description of the collection. For multilingual collections, this will be the description of the default language's content.
**translated_content:** `typing.Optional[GroupTranslatedContent]`
**parent_id:** `typing.Optional[str]` — The id of the parent collection. If `null` then it will be created as the first level collection.
**help_center_id:** `typing.Optional[int]` — The id of the help center where the collection will be created. If `null` then it will be created in the default help center.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.retrieve_collection(...)
#### 📝 Description
You can fetch the details of a single collection by making a GET request to `https://api.intercom.io/help_center/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.retrieve_collection( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.update_collection(...)
#### 📝 Description
You can update the details of a single collection by making a PUT request to `https://api.intercom.io/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.update_collection( id=1, name="Update collection name", ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the collection which is given by Intercom.
**name:** `typing.Optional[str]` — The name of the collection. For multilingual collections, this will be the name of the default language's content.
**description:** `typing.Optional[str]` — The description of the collection. For multilingual collections, this will be the description of the default language's content.
**translated_content:** `typing.Optional[GroupTranslatedContent]`
**parent_id:** `typing.Optional[str]` — The id of the parent collection. If `null` then it will be updated as the first level collection.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.delete_collection(...)
#### 📝 Description
You can delete a single collection by making a DELETE request to `https://api.intercom.io/collections/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.delete_collection( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.retrieve_help_center(...)
#### 📝 Description
You can fetch the details of a single Help Center by making a GET request to `https://api.intercom.io/help_center/help_center/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.retrieve_help_center( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the collection which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.help_center.list_help_centers()
#### 📝 Description
You can list all Help Centers by making a GET request to `https://api.intercom.io/help_center/help_centers`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.help_center.list_help_centers() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Internal Articles
client.unstable.internal_articles.list_internal_articles()
#### 📝 Description
You can fetch a list of all internal articles by making a GET request to `https://api.intercom.io/internal_articles`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.list_internal_articles() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.internal_articles.create_internal_article(...)
#### 📝 Description
You can create a new internal article by making a POST request to `https://api.intercom.io/internal_articles`.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CreateInternalArticleRequest client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.create_internal_article( request=CreateInternalArticleRequest( title="Thanks for everything", body="Body of the Internal Article", author_id=1295, owner_id=1295, ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateInternalArticleRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.internal_articles.retrieve_internal_article(...)
#### 📝 Description
You can fetch the details of a single internal article by making a GET request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.retrieve_internal_article( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.internal_articles.update_internal_article(...)
#### 📝 Description
You can update the details of a single internal article by making a PUT request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.update_internal_article( id=1, title="Christmas is here!", body="

New gifts in store for the jolly season

", ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the internal article which is given by Intercom.
**title:** `typing.Optional[str]` — The title of the article.
**body:** `typing.Optional[str]` — The content of the article.
**author_id:** `typing.Optional[int]` — The id of the author of the article.
**owner_id:** `typing.Optional[int]` — The id of the author of the article.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.internal_articles.delete_internal_article(...)
#### 📝 Description
You can delete a single internal article by making a DELETE request to `https://api.intercom.io/internal_articles/`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.delete_internal_article( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the internal article which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.internal_articles.search_internal_articles(...)
#### 📝 Description
You can search for internal articles by making a GET request to `https://api.intercom.io/internal_articles/search`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.internal_articles.search_internal_articles( folder_id="folder_id", ) ```
#### ⚙️ Parameters
**folder_id:** `typing.Optional[str]` — The ID of the folder to search in.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Companies
client.unstable.companies.retrieve_company(...)
#### 📝 Description
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}`
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.retrieve_company( name="my company", company_id="12345", tag_id="678910", segment_id="98765", page=1, per_page=1, ) ```
#### ⚙️ Parameters
**name:** `typing.Optional[str]` — The `name` of the company to filter by.
**company_id:** `typing.Optional[str]` — The `company_id` of the company to filter by.
**tag_id:** `typing.Optional[str]` — The `tag_id` of the company to filter by.
**segment_id:** `typing.Optional[str]` — The `segment_id` of the company to filter by.
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 15
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.create_or_update_company(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.create_or_update_company( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.retrieve_a_company_by_id(...)
#### 📝 Description
You can fetch a single company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.retrieve_a_company_by_id( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.update_company(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.update_company( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.delete_company(...)
#### 📝 Description
You can delete a single company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.delete_company( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.list_attached_contacts(...)
#### 📝 Description
You can fetch a list of all contacts that belong to a company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.list_attached_contacts( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.list_attached_segments_for_companies(...)
#### 📝 Description
You can fetch a list of all segments that belong to a company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.list_attached_segments_for_companies( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.list_all_companies(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.list_all_companies( page=1, per_page=1, order="desc", ) ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to return per page. Defaults to 15
**order:** `typing.Optional[str]` — `asc` or `desc`. Return the companies in ascending or descending order. Defaults to desc
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.scroll_over_all_companies(...)
#### 📝 Description
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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.scroll_over_all_companies( scroll_param="scroll_param", ) ```
#### ⚙️ Parameters
**scroll_param:** `typing.Optional[str]` —
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.attach_contact_to_a_company(...)
#### 📝 Description
You can attach a company to a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.attach_contact_to_a_company( id="id", company_id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the contact which is given by Intercom
**company_id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.companies.detach_contact_from_a_company(...)
#### 📝 Description
You can detach a company from a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.companies.detach_contact_from_a_company( contact_id="58a430d35458202d41b1e65b", id="58a430d35458202d41b1e65b", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Notes
client.unstable.notes.list_company_notes(...)
#### 📝 Description
You can fetch a list of notes that are associated to a company.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.notes.list_company_notes( id="5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the company which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.notes.list_notes(...)
#### 📝 Description
You can fetch a list of notes that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.notes.list_notes( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier of a contact.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.notes.create_note(...)
#### 📝 Description
You can add a note to a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.notes.create_note( id=1, body="Hello", contact_id="123", admin_id="123", ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier of a given contact.
**body:** `str` — The text of the note.
**contact_id:** `typing.Optional[str]` — The unique identifier of a given contact.
**admin_id:** `typing.Optional[str]` — The unique identifier of a given admin.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.notes.retrieve_note(...)
#### 📝 Description
You can fetch the details of a single note.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.notes.retrieve_note( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier of a given note
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Contacts
client.unstable.contacts.list_companies_for_a_contact(...)
#### 📝 Description
You can fetch a list of companies that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.list_companies_for_a_contact( id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.list_segments_for_a_contact(...)
#### 📝 Description
You can fetch a list of segments that are associated to a contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.list_segments_for_a_contact( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.list_subscriptions_for_a_contact(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.list_subscriptions_for_a_contact( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.list_tags_for_a_contact(...)
#### 📝 Description
You can fetch a list of all tags that are attached to a specific contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.list_tags_for_a_contact( contact_id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.show_contact(...)
#### 📝 Description
You can fetch the details of a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.show_contact( id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**id:** `str` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.update_contact(...)
#### 📝 Description
You can update an existing contact (ie. user or lead). {% admonition type="info" %} This endpoint handles both **contact updates** and **custom object associations**. See _`update a contact with an association to a custom object instance`_ in the request/response examples to see the custom object association format. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.update_contact( id="63a07ddf05a32042dffac965", custom_attributes={"order": ["21"]}, ) ```
#### ⚙️ Parameters
**id:** `str` — id
**role:** `typing.Optional[str]` — The role of the contact.
**external_id:** `typing.Optional[str]` — A unique identifier for the contact which is given to Intercom
**email:** `typing.Optional[str]` — The contacts email
**phone:** `typing.Optional[str]` — The contacts phone
**name:** `typing.Optional[str]` — The contacts name
**avatar:** `typing.Optional[str]` — An image URL containing the avatar of a contact
**signed_up_at:** `typing.Optional[int]` — The time specified for when a contact signed up
**last_seen_at:** `typing.Optional[int]` — The time when the contact was last seen (either where the Intercom Messenger was installed or when specified manually)
**owner_id:** `typing.Optional[int]` — The id of an admin that has been assigned account ownership of the contact
**unsubscribed_from_emails:** `typing.Optional[bool]` — Whether the contact is unsubscribed from emails
**language_override:** `typing.Optional[str]` — A preferred language setting for the contact, used by Intercom as the language of Fin and the Messenger even if their browser has a different setting. Supports ISO 639-1 two-letter language codes. If an unsupported code is supplied, the field will be set to null.
**custom_attributes:** `typing.Optional[typing.Dict[str, typing.Any]]` — The custom attributes which are set for the contact
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.delete_contact(...)
#### 📝 Description
You can delete a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.delete_contact( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.merge_contact(...)
#### 📝 Description
You can merge a contact with a `role` of `lead` into a contact with a `role` of `user`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.merge_contact( from_="6762f0d51bb69f9f2193bb7f", into="6762f0d51bb69f9f2193bb80", ) ```
#### ⚙️ Parameters
**from_:** `typing.Optional[str]` — The unique identifier for the contact to merge away from. Must be a lead.
**into:** `typing.Optional[str]` — The unique identifier for the contact to merge into. Must be a user.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.search_contacts(...)
#### 📝 Description
You can search for multiple contacts by the value of their attributes in order to fetch exactly who you want. To search for contacts, you need to send a `POST` request to `https://api.intercom.io/contacts/search`. This will accept a query object in the body which will define your filters in order to search for contacts. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is `50` results per page. See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Contact Creation Delay If a contact has recently been created, there is a possibility that it will not yet be available when searching. This means that it may not appear in the response. This delay can take a few minutes. If you need to be instantly notified it is recommended to use webhooks and iterate to see if they match your search filters. ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiple's there can be: * There's a limit of max 2 nested filters * There's a limit of max 15 filters for each AND or OR group ### Searching for Timestamp Fields All timestamp fields (created_at, updated_at etc.) are indexed as Dates for Contact Search queries; Datetime queries are not currently supported. This means you can only query for timestamp fields by day - not hour, minute or second. For example, if you search for all Contacts with a created_at value greater (>) than 1577869200 (the UNIX timestamp for January 1st, 2020 9:00 AM), that will be interpreted as 1577836800 (January 1st, 2020 12:00 AM). The search results will then include Contacts created from January 2nd, 2020 12:00 AM onwards. If you'd like to get contacts created on January 1st, 2020 you should search with a created_at value equal (=) to 1577836800 (January 1st, 2020 12:00 AM). This behaviour applies only to timestamps used in search queries. The search results will still contain the full UNIX timestamp and be sorted accordingly. ### Accepted Fields Most key listed as part of the Contacts Model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foorbar"`). | Field | Type | | ---------------------------------- | ------------------------------ | | id | String | | role | String
Accepts user or lead | | name | String | | avatar | String | | owner_id | Integer | | email | String | | email_domain | String | | phone | String | | formatted_phone | String | | external_id | String | | created_at | Date (UNIX Timestamp) | | signed_up_at | Date (UNIX Timestamp) | | updated_at | Date (UNIX Timestamp) | | last_seen_at | Date (UNIX Timestamp) | | last_contacted_at | Date (UNIX Timestamp) | | last_replied_at | Date (UNIX Timestamp) | | last_email_opened_at | Date (UNIX Timestamp) | | last_email_clicked_at | Date (UNIX Timestamp) | | language_override | String | | browser | String | | browser_language | String | | os | String | | location.country | String | | location.region | String | | location.city | String | | unsubscribed_from_emails | Boolean | | marked_email_as_spam | Boolean | | has_hard_bounced | Boolean | | ios_last_seen_at | Date (UNIX Timestamp) | | ios_app_version | String | | ios_device | String | | ios_app_device | String | | ios_os_version | String | | ios_app_name | String | | ios_sdk_version | String | | android_last_seen_at | Date (UNIX Timestamp) | | android_app_version | String | | android_device | String | | android_app_name | String | | andoid_sdk_version | String | | segment_id | String | | tag_id | String | | custom_attributes.{attribute_name} | String | ### Accepted Operators {% admonition type="warning" name="Searching based on `created_at`" %} You cannot use the `<=` or `>=` operators to search by `created_at`. {% /admonition %} The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :------------------------------- | :--------------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In
Shortcut for `OR` queries
Values must be in Array | | NIN | All | Not In
Shortcut for `OR !` queries
Values must be in Array | | > | Integer
Date (UNIX Timestamp) | Greater than | | < | Integer
Date (UNIX Timestamp) | Lower than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ( MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.search_contacts( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.list_contacts()
#### 📝 Description
You can fetch a list of all contacts (ie. users or leads) in your workspace. {% admonition type="warning" name="Pagination" %} You can use pagination to limit the number of results returned. The default is `50` 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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.list_contacts() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.create_contact(...)
#### 📝 Description
You can create a new contact (ie. user or lead).
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.create_contact( request={"email": "joebloggs@intercom.io"}, ) ```
#### ⚙️ Parameters
**request:** `CreateContactRequestTwo`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.show_contact_by_external_id(...)
#### 📝 Description
You can fetch the details of a single contact by external ID. Note that this endpoint only supports users and not leads.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.show_contact_by_external_id( external_id="cdd29344-5e0c-4ef0-ac56-f9ba2979bc27", ) ```
#### ⚙️ Parameters
**external_id:** `str` — The external ID of the user that you want to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.archive_contact(...)
#### 📝 Description
You can archive a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.archive_contact( id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**id:** `str` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.unarchive_contact(...)
#### 📝 Description
You can unarchive a single contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.unarchive_contact( id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**id:** `str` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.contacts.block_contact(...)
#### 📝 Description
Block a single contact.
**Note:** conversations of the contact will also be archived during the process.
More details in [FAQ How do I block Inbox spam?](https://www.intercom.com/help/en/articles/8838656-inbox-faqs)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.contacts.block_contact( id="63a07ddf05a32042dffac965", ) ```
#### ⚙️ Parameters
**id:** `str` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Subscription Types
client.unstable.subscription_types.attach_subscription_type_to_contact(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.subscription_types.attach_subscription_type_to_contact( contact_id="63a07ddf05a32042dffac965", id="invalid_id", consent_type="opt_in", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**id:** `str` — The unique identifier for the subscription which is given by Intercom
**consent_type:** `str` — The consent_type of a subscription, opt_out or opt_in.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.subscription_types.detach_subscription_type_to_contact(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.subscription_types.detach_subscription_type_to_contact( contact_id="63a07ddf05a32042dffac965", id="37846", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**id:** `str` — The unique identifier for the subscription type which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.subscription_types.list_subscription_types()
#### 📝 Description
You can list all subscription types. A list of subscription type objects will be returned.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.subscription_types.list_subscription_types() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Tags
client.unstable.tags.attach_tag_to_contact(...)
#### 📝 Description
You can tag a specific contact. This will return a tag object for the tag that was added to the contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.attach_tag_to_contact( contact_id="63a07ddf05a32042dffac965", id="123", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**id:** `str` — The unique identifier for the tag which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.detach_tag_from_contact(...)
#### 📝 Description
You can remove tag from a specific contact. This will return a tag object for the tag that was removed from the contact.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.detach_tag_from_contact( contact_id="63a07ddf05a32042dffac965", id="7522907", ) ```
#### ⚙️ Parameters
**contact_id:** `str` — The unique identifier for the contact which is given by Intercom
**id:** `str` — The unique identifier for the tag which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.attach_tag_to_conversation(...)
#### 📝 Description
You can tag a specific conversation. This will return a tag object for the tag that was added to the conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.attach_tag_to_conversation( conversation_id="64619700005694", id="7522907", admin_id="780", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — conversation_id
**id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.detach_tag_from_conversation(...)
#### 📝 Description
You can remove tag from a specific conversation. This will return a tag object for the tag that was removed from the conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.detach_tag_from_conversation( conversation_id="64619700005694", id="7522907", admin_id="123", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — conversation_id
**id:** `str` — id
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.list_tags()
#### 📝 Description
You can fetch a list of all tags for a given workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.list_tags() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.create_tag(...)
#### 📝 Description
You can use this endpoint to perform the following operations: **1. Create a new tag:** You can create a new tag by passing in the tag name as specified in "Create or Update Tag Request Payload" described below. **2. Update an existing tag:** You can update an existing tag by passing the id of the tag as specified in "Create or Update Tag Request Payload" described below. **3. Tag Companies:** You can tag single company or a list of companies. You can tag a company by passing in the tag name and the company details as specified in "Tag Company Request Payload" described below. Also, if the tag doesn't exist then a new one will be created automatically. **4. Untag Companies:** You can untag a single company or a list of companies. You can untag a company by passing in the tag id and the company details as specified in "Untag Company Request Payload" described below. **5. Tag Multiple Users:** You can tag a list of users. You can tag the users by passing in the tag name and the user details as specified in "Tag Users Request Payload" described below. Each operation will return a tag object.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ( TagMultipleUsersRequest, TagMultipleUsersRequestUsersItem, ) client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.create_tag( request=TagMultipleUsersRequest( name="test", users=[ TagMultipleUsersRequestUsersItem( id="123", ) ], ), ) ```
#### ⚙️ Parameters
**request:** `CreateTagRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.find_tag(...)
#### 📝 Description
You can fetch the details of tags that are on the workspace by their id. This will return a tag object.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.find_tag( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of a given tag
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.delete_tag(...)
#### 📝 Description
You can delete the details of tags that are on the workspace by passing in the id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.delete_tag( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of a given tag
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.attach_tag_to_ticket(...)
#### 📝 Description
You can tag a specific ticket. This will return a tag object for the tag that was added to the ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.attach_tag_to_ticket( ticket_id="64619700005694", id="7522907", admin_id="780", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — ticket_id
**id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tags.detach_tag_from_ticket(...)
#### 📝 Description
You can remove tag from a specific ticket. This will return a tag object for the tag that was removed from the ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tags.detach_tag_from_ticket( ticket_id="64619700005694", id="7522907", admin_id="123", ) ```
#### ⚙️ Parameters
**ticket_id:** `str` — ticket_id
**id:** `str` — The unique identifier for the tag which is given by Intercom
**admin_id:** `str` — The unique identifier for the admin which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Conversations
client.unstable.conversations.list_conversations(...)
#### 📝 Description
You can fetch a list of all conversations. You can optionally request the result page size and the cursor to start after to fetch the result. {% 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 %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.list_conversations( per_page=1, starting_after="starting_after", ) ```
#### ⚙️ Parameters
**per_page:** `typing.Optional[int]` — How many results per page
**starting_after:** `typing.Optional[str]` — String used to get the next page of conversations.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.create_conversation(...)
#### 📝 Description
You can create a conversation that has been initiated by a contact (ie. user or lead). The conversation can be an in-app message only. {% admonition type="info" name="Sending for visitors" %} You can also send a message from a visitor by specifying their `user_id` or `id` value in the `from` field, along with a `type` field value of `contact`. This visitor will be automatically converted to a contact with a lead role once the conversation is created. {% /admonition %} This will return the Message model that has been created.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable.conversations import CreateConversationRequestFrom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.create_conversation( from_=CreateConversationRequestFrom( type="user", id="123_doesnt_exist", ), body="Hello there", ) ```
#### ⚙️ Parameters
**from_:** `CreateConversationRequestFrom`
**body:** `str` — The content of the message. HTML is not supported.
**created_at:** `typing.Optional[int]` — The time the conversation was created as a UTC Unix timestamp. If not provided, the current time will be used. This field is only recommneded for migrating past conversations from another source into Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.retrieve_conversation(...)
#### 📝 Description
You can fetch the details of a single conversation. This will return a single Conversation model with all its conversation parts. {% admonition type="warning" name="Hard limit of 500 parts" %} The maximum number of conversation parts that can be returned via the API is 500. If you have more than that we will return the 500 most recent conversation parts. {% /admonition %} For AI agent conversation metadata, please note that you need to have the agent enabled in your workspace, which is a [paid feature](https://www.intercom.com/help/en/articles/8205718-fin-resolutions#h_97f8c2e671).
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.retrieve_conversation( id=1, display_as="plaintext", include_translations=True, ) ```
#### ⚙️ Parameters
**id:** `int` — The id of the conversation to target
**display_as:** `typing.Optional[str]` — Set to plaintext to retrieve conversation messages in plain text. This affects both the body and subject fields.
**include_translations:** `typing.Optional[bool]` — If set to true, conversation parts will be translated to the detected language of the conversation.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.update_conversation(...)
#### 📝 Description
You can update an existing conversation. {% admonition type="info" name="Replying and other actions" %} If you want to reply to a coveration or take an action such as assign, unassign, open, close or snooze, take a look at the reply and manage endpoints. {% /admonition %} {% admonition type="info" %} This endpoint handles both **conversation updates** and **custom object associations**. See _`update a conversation with an association to a custom object instance`_ in the request/response examples to see the custom object association format. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.update_conversation( id=1, display_as="plaintext", read=True, title="new conversation title", custom_attributes={"issue_type": "Billing", "priority": "High"}, ) ```
#### ⚙️ Parameters
**id:** `int` — The id of the conversation to target
**display_as:** `typing.Optional[str]` — Set to plaintext to retrieve conversation messages in plain text. This affects both the body and subject fields.
**read:** `typing.Optional[bool]` — Mark a conversation as read within Intercom.
**title:** `typing.Optional[str]` — The title given to the conversation
**custom_attributes:** `typing.Optional[CustomAttributes]`
**company_id:** `typing.Optional[str]` — The ID of the company that the conversation is associated with. The unique identifier for the company which is given by Intercom. Set to nil to remove company.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.delete_conversation(...)
#### 📝 Description
You can delete a single conversation.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.delete_conversation( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — id
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.search_conversations(...)
#### 📝 Description
You can search for multiple conversations by the value of their attributes in order to fetch exactly which ones you want. To search for conversations, you need to send a `POST` request to `https://api.intercom.io/conversations/search`. This will accept a query object in the body which will define your filters in order to search for conversations. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is `20` results per page and maximum is `150`. See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiple's there can be: - There's a limit of max 2 nested filters - There's a limit of max 15 filters for each AND or OR group ### Accepted Fields Most keys listed in the conversation model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foorbar"`). The `source.body` field is unique as the search will not be performed against the entire value, but instead against every element of the value separately. For example, when searching for a conversation with a `"I need support"` body - the query should contain a `=` operator with the value `"support"` for such conversation to be returned. A query with a `=` operator and a `"need support"` value will not yield a result. | Field | Type | | :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | | id | String | | created_at | Date (UNIX timestamp) | | updated_at | Date (UNIX timestamp) | | source.type | String
Accepted fields are `conversation`, `email`, `facebook`, `instagram`, `phone_call`, `phone_switch`, `push`, `sms`, `twitter` and `whatsapp`. | | source.id | String | | source.delivered_as | String | | source.subject | String | | source.body | String | | source.author.id | String | | source.author.type | String | | source.author.name | String | | source.author.email | String | | source.url | String | | contact_ids | String | | teammate_ids | String | | admin_assignee_id | String | | team_assignee_id | String | | channel_initiated | String | | open | Boolean | | read | Boolean | | state | String | | waiting_since | Date (UNIX timestamp) | | snoozed_until | Date (UNIX timestamp) | | tag_ids | String | | priority | String | | statistics.time_to_assignment | Integer | | statistics.time_to_admin_reply | Integer | | statistics.time_to_first_close | Integer | | statistics.time_to_last_close | Integer | | statistics.median_time_to_reply | Integer | | statistics.first_contact_reply_at | Date (UNIX timestamp) | | statistics.first_assignment_at | Date (UNIX timestamp) | | statistics.first_admin_reply_at | Date (UNIX timestamp) | | statistics.first_close_at | Date (UNIX timestamp) | | statistics.last_assignment_at | Date (UNIX timestamp) | | statistics.last_assignment_admin_reply_at | Date (UNIX timestamp) | | statistics.last_contact_reply_at | Date (UNIX timestamp) | | statistics.last_admin_reply_at | Date (UNIX timestamp) | | statistics.last_close_at | Date (UNIX timestamp) | | statistics.last_closed_by_id | String | | statistics.count_reopens | Integer | | statistics.count_assignments | Integer | | statistics.count_conversation_parts | Integer | | conversation_rating.requested_at | Date (UNIX timestamp) | | conversation_rating.replied_at | Date (UNIX timestamp) | | conversation_rating.score | Integer | | conversation_rating.remark | String | | conversation_rating.contact_id | String | | conversation_rating.admin_d | String | | ai_agent_participated | Boolean | | ai_agent.resolution_state | String | | ai_agent.last_answer_type | String | | ai_agent.rating | Integer | | ai_agent.rating_remark | String | | ai_agent.source_type | String | | ai_agent.source_title | String | ### Accepted Operators The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :----------------------------- | :----------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In Shortcut for `OR` queries Values most be in Array | | NIN | All | Not In Shortcut for `OR !` queries Values must be in Array | | > | Integer Date (UNIX Timestamp) | Greater (or equal) than | | < | Integer Date (UNIX Timestamp) | Lower (or equal) than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ( MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.search_conversations( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.reply_conversation(...)
#### 📝 Description
You can reply to a conversation with a message from an admin or on behalf of a contact, or with a note for admins.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ContactReplyIntercomUserIdRequest client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.reply_conversation( id='123 or "last"', request=ContactReplyIntercomUserIdRequest( body="Thanks again :)", intercom_user_id="6762f1661bb69f9f2193bbbf", ), ) ```
#### ⚙️ Parameters
**id:** `str` — The Intercom provisioned identifier for the conversation or the string "last" to reply to the last part of the conversation
**request:** `ReplyConversationRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.manage_conversation(...)
#### 📝 Description
For managing conversations you can: - Close a conversation - Snooze a conversation to reopen on a future date - Open a conversation which is `snoozed` or `closed` - Assign a conversation to an admin and/or team.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable.conversations import ManageConversationRequestBody_Close client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.manage_conversation( id="123", request=ManageConversationRequestBody_Close( admin_id="12345", ), ) ```
#### ⚙️ Parameters
**id:** `str` — The identifier for the conversation as given by Intercom.
**request:** `ManageConversationRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.attach_contact_to_conversation(...)
#### 📝 Description
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin. {% admonition type="warning" name="Contacts without an email" %} If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable.conversations import ( AttachContactToConversationRequestCustomerIntercomUserId, ) client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.attach_contact_to_conversation( id="123", admin_id="12345", customer=AttachContactToConversationRequestCustomerIntercomUserId( intercom_user_id="6762f19e1bb69f9f2193bbd5", ), ) ```
#### ⚙️ Parameters
**id:** `str` — The identifier for the conversation as given by Intercom.
**admin_id:** `typing.Optional[str]` — The `id` of the admin who is adding the new participant.
**customer:** `typing.Optional[AttachContactToConversationRequestCustomer]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.detach_contact_from_conversation(...)
#### 📝 Description
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin. {% admonition type="warning" name="Contacts without an email" %} If you add a contact via the email parameter and there is no user/lead found on that workspace with he given email, then we will create a new contact with `role` set to `lead`. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.detach_contact_from_conversation( conversation_id="123", contact_id="123", admin_id="5017690", ) ```
#### ⚙️ Parameters
**conversation_id:** `str` — The identifier for the conversation as given by Intercom.
**contact_id:** `str` — The identifier for the contact as given by Intercom.
**admin_id:** `str` — The `id` of the admin who is performing the action.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.list_handling_events(...)
#### 📝 Description
List all pause/resume events for a conversation. These events track when teammates paused or resumed handling a conversation. Requires the `read_conversations` OAuth scope.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.list_handling_events( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The identifier for the conversation as given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.redact_conversation(...)
#### 📝 Description
You can redact a conversation part or the source message of a conversation (as seen in the source object). {% admonition type="info" name="Redacting parts and messages" %} If you are redacting a conversation part, it must have a `body`. If you are redacting a source message, it must have been created by a contact. We will return a `conversation_part_not_redactable` error if these criteria are not met. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import RedactConversationRequest_ConversationPart client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.redact_conversation( request=RedactConversationRequest_ConversationPart( conversation_id="really_123_doesnt_exist", conversation_part_id="really_123_doesnt_exist", ), ) ```
#### ⚙️ Parameters
**request:** `RedactConversationRequest`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.conversations.convert_conversation_to_ticket(...)
#### 📝 Description
You can convert a conversation to a ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.conversations.convert_conversation_to_ticket( id=1, ticket_type_id="54", ) ```
#### ⚙️ Parameters
**id:** `int` — The id of the conversation to target
**ticket_type_id:** `str` — The ID of the type of ticket you want to convert the conversation to
**attributes:** `typing.Optional[TicketRequestCustomAttributes]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Unstable CustomChannelEvents
client.unstable.custom_channel_events.notify_new_conversation(...)
#### 📝 Description
Notifies Intercom that a new conversation was created in your custom channel/platform. This triggers conversation creation and workflow automations within Intercom for your custom channel integration. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CustomChannelContact client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_channel_events.notify_new_conversation( event_id="evt_12345", external_conversation_id="conv_67890", contact=CustomChannelContact( type="user", external_id="user_001", name="Jane Doe", email="jane.doe@example.com", ), ) ```
#### ⚙️ Parameters
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_channel_events.notify_new_message(...)
#### 📝 Description
Notifies Intercom that a new message was sent in a conversation on your custom channel/platform. This allows Intercom to process the message and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CustomChannelContact client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_channel_events.notify_new_message( event_id="evt_54321", external_conversation_id="conv_98765", contact=CustomChannelContact( type="user", external_id="user_002", name="John Smith", email="john.smith@example.com", ), body="Hello, I need help with my order.", ) ```
#### ⚙️ Parameters
**body:** `str` — The message content sent by the user.
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_channel_events.notify_quick_reply_selected(...)
#### 📝 Description
Notifies Intercom that a user selected a quick reply option in your custom channel/platform. This allows Intercom to process the response and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CustomChannelContact client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_channel_events.notify_quick_reply_selected( event_id="evt_67890", external_conversation_id="conv_13579", contact=CustomChannelContact( type="user", external_id="user_003", name="Alice Example", email="alice@example.com", ), quick_reply_option_id="1234", ) ```
#### ⚙️ Parameters
**quick_reply_option_id:** `str` — Id of the selected quick reply option.
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_channel_events.notify_attribute_collected(...)
#### 📝 Description
Notifies Intercom that a user provided a response to an attribute collector in your custom channel/platform. This allows Intercom to process the attribute and trigger any relevant workflow automations. > **Note:** This endpoint is currently under managed availability. Please reach out to your accounts team to discuss access and tailored, hands-on support.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CustomChannelAttribute, CustomChannelContact client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_channel_events.notify_attribute_collected( event_id="evt_24680", external_conversation_id="conv_11223", contact=CustomChannelContact( type="user", external_id="user_004", name="Bob Example", email="bob@example.com", ), attribute=CustomChannelAttribute( id="shipping_address", value="123 Main St, Springfield", ), ) ```
#### ⚙️ Parameters
**attribute:** `CustomChannelAttribute`
**event_id:** `str` — Unique identifier for the event.
**external_conversation_id:** `str` — Identifier for the conversation in your application.
**contact:** `CustomChannelContact`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Custom Object Instances
client.unstable.custom_object_instances.get_custom_object_instances_by_external_id(...)
#### 📝 Description
Fetch a Custom Object Instance by external_id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_object_instances.get_custom_object_instances_by_external_id( custom_object_type_identifier="Order", external_id="external_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_object_instances.create_custom_object_instances(...)
#### 📝 Description
Create or update a custom object instance
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_object_instances.create_custom_object_instances( 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", }, ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `typing.Optional[str]` — A unique identifier for the Custom Object instance in the external system it originated from.
**external_created_at:** `typing.Optional[int]` — The time when the Custom Object instance was created in the external system it originated from.
**external_updated_at:** `typing.Optional[int]` — The time when the Custom Object instance was last updated in the external system it originated from.
**custom_attributes:** `typing.Optional[typing.Dict[str, typing.Optional[str]]]` — The custom attributes which are set for the Custom Object instance.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_object_instances.delete_custom_object_instances_by_id(...)
#### 📝 Description
Delete a single Custom Object instance by external_id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_object_instances.delete_custom_object_instances_by_id( custom_object_type_identifier="Order", external_id="external_id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**external_id:** `str`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_object_instances.get_custom_object_instances_by_id(...)
#### 📝 Description
Fetch a Custom Object Instance by id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_object_instances.get_custom_object_instances_by_id( custom_object_type_identifier="Order", id="id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**id:** `str` — The id or external_id of the custom object instance
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.custom_object_instances.delete_custom_object_instances_by_external_id(...)
#### 📝 Description
Delete a single Custom Object instance using the Intercom defined id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.custom_object_instances.delete_custom_object_instances_by_external_id( custom_object_type_identifier="Order", id="id", ) ```
#### ⚙️ Parameters
**custom_object_type_identifier:** `str` — The unique identifier of the custom object type that defines the structure of the custom object instance.
**id:** `str` — The Intercom defined id of the custom object instance
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Data Attributes
client.unstable.data_attributes.lis_data_attributes(...)
#### 📝 Description
You can fetch a list of all data attributes belonging to a workspace for contacts, companies or conversations.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_attributes.lis_data_attributes( model="contact", include_archived=True, ) ```
#### ⚙️ Parameters
**model:** `typing.Optional[LisDataAttributesRequestModel]` — Specify the data attribute model to return.
**include_archived:** `typing.Optional[bool]` — Include archived attributes in the list. By default we return only non archived data attributes.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_attributes.create_data_attribute(...)
#### 📝 Description
You can create a data attributes for a `contact` or a `company`.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_attributes.create_data_attribute( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_attributes.update_data_attribute(...)
#### 📝 Description
You can update a data attribute. > 🚧 Updating the data type is not possible > > It is currently a dangerous action to execute changing a data attribute's type via the API. You will need to update the type via the UI instead.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_attributes.update_data_attribute( id=1, request={"key": "value"}, ) ```
#### ⚙️ Parameters
**id:** `int` — The data attribute id
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Data Events
client.unstable.data_events.lis_data_events(...)
#### 📝 Description
> 🚧 > > Please note that you can only 'list' events that are less than 90 days old. Event counts and summaries will still include your events older than 90 days but you cannot 'list' these events individually if they are older than 90 days The events belonging to a customer can be listed by sending a GET request to `https://api.intercom.io/events` with a user or lead identifier along with a `type` parameter. The identifier parameter can be one of `user_id`, `email` or `intercom_user_id`. The `type` parameter value must be `user`. - `https://api.intercom.io/events?type=user&user_id={user_id}` - `https://api.intercom.io/events?type=user&email={email}` - `https://api.intercom.io/events?type=user&intercom_user_id={id}` (this call can be used to list leads) The `email` parameter value should be [url encoded](http://en.wikipedia.org/wiki/Percent-encoding) when sending. You can optionally define the result page size as well with the `per_page` parameter.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable.data_events import LisDataEventsRequestFilterUserId client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_events.lis_data_events( filter=LisDataEventsRequestFilterUserId( user_id="user_id", ), type="type", ) ```
#### ⚙️ Parameters
**filter:** `LisDataEventsRequestFilter`
**type:** `str` — The value must be user
**summary:** `typing.Optional[bool]` — summary flag
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_events.create_data_event(...)
#### 📝 Description
You will need an Access Token that has write permissions to send Events. Once you have a key you can submit events via POST to the Events resource, which is located at https://api.intercom.io/events, or you can send events using one of the client libraries. When working with the HTTP API directly a client should send the event with a `Content-Type` of `application/json`. When using the JavaScript API, [adding the code to your app](http://docs.intercom.io/configuring-Intercom/tracking-user-events-in-your-app) makes the Events API available. Once added, you can submit an event using the `trackEvent` method. This will associate the event with the Lead or currently logged-in user or logged-out visitor/lead and send it to Intercom. The final parameter is a map that can be used to send optional metadata about the event. With the Ruby client you pass a hash describing the event to `Intercom::Event.create`, or call the `track_user` method directly on the current user object (e.g. `user.track_event`). **NB: For the JSON object types, please note that we do not currently support nested JSON structure.** | Type | Description | Example | | :-------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- | | String | The value is a JSON String | `"source":"desktop"` | | Number | The value is a JSON Number | `"load": 3.67` | | Date | The key ends with the String `_date` and the value is a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time), assumed to be in the [UTC](http://en.wikipedia.org/wiki/Coordinated_Universal_Time) timezone. | `"contact_date": 1392036272` | | Link | The value is a HTTP or HTTPS URI. | `"article": "https://example.org/ab1de.html"` | | Rich Link | The value is a JSON object that contains `url` and `value` keys. | `"article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}` | | Monetary Amount | The value is a JSON object that contains `amount` and `currency` keys. The `amount` key is a positive integer representing the amount in cents. The price in the example to the right denotes €349.99. | `"price": {"amount": 34999, "currency": "eur"}` | **Lead Events** When submitting events for Leads, you will need to specify the Lead's `id`. **Metadata behaviour** - We currently limit the number of tracked metadata keys to 10 per event. Once the quota is reached, we ignore any further keys we receive. The first 10 metadata keys are determined by the order in which they are sent in with the event. - It is not possible to change the metadata keys once the event has been sent. A new event will need to be created with the new keys and you can archive the old one. - There might be up to 24 hrs delay when you send a new metadata for an existing event. **Event de-duplication** The API may detect and ignore duplicate events. Each event is uniquely identified as a combination of the following data - the Workspace identifier, the Contact external identifier, the Data Event name and the Data Event created time. As a result, it is **strongly recommended** to send a second granularity Unix timestamp in the `created_at` field. Duplicated events are responded to using the normal `202 Accepted` code - an error is not thrown, however repeat requests will be counted against any rate limit that is in place. ### HTTP API Responses - Successful responses to submitted events return `202 Accepted` with an empty body. - Unauthorised access will be rejected with a `401 Unauthorized` or `403 Forbidden` response code. - Events sent about users that cannot be found will return a `404 Not Found`. - Event lists containing duplicate events will have those duplicates ignored. - Server errors will return a `500` response code and may contain an error message in the body.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_events.create_data_event( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `CreateDataEventRequestTwo`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_events.data_event_summaries(...)
#### 📝 Description
Create event summaries for a user. Event summaries are used to track the number of times an event has occurred, the first time it occurred and the last time it occurred.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_events.data_event_summaries() ```
#### ⚙️ Parameters
**user_id:** `typing.Optional[str]` — Your identifier for the user.
**event_summaries:** `typing.Optional[CreateDataEventSummariesRequestEventSummaries]` — A list of event summaries for the user. Each event summary should contain the event name, the time the event occurred, and the number of times the event occurred. The event name should be a past tense 'verb-noun' combination, to improve readability, for example `updated-plan`.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Data Export
client.unstable.data_export.create_data_export(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_export.create_data_export( created_at_after=1734519776, created_at_before=1734537776, ) ```
#### ⚙️ Parameters
**created_at_after:** `int` — The start date that you request data for. It must be formatted as a unix timestamp.
**created_at_before:** `int` — The end date that you request data for. It must be formatted as a unix timestamp.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_export.get_data_export(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_export.get_data_export( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_export.cancel_data_export(...)
#### 📝 Description
You can cancel your job
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_export.cancel_data_export( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.data_export.download_data_export(...)
#### 📝 Description
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.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.data_export.download_data_export( job_identifier="job_identifier", ) ```
#### ⚙️ Parameters
**job_identifier:** `str` — job_identifier
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Workflows
client.unstable.workflows.export_workflow(...)
#### 📝 Description
Export a workflow configuration by its ID. This endpoint returns the complete workflow definition including its steps, targeting rules, and attributes. This endpoint is designed for EU Data Act compliance, allowing customers to export their workflow configurations. {% admonition type="warning" name="Unstable API" %} This API is currently in the Unstable version. Its behavior may change in future releases. {% /admonition %}
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.workflows.export_workflow( id="12345", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the workflow
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Jobs
client.unstable.jobs.status(...)
#### 📝 Description
Retrieve the status of job execution.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.jobs.status( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the job which is given by Intercom
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Macros
client.unstable.macros.list_macros(...)
#### 📝 Description
You can fetch a list of all macros (saved replies) in your workspace for use in automating responses. The macros are returned in descending order by updated_at. **Pagination** This endpoint uses cursor-based pagination via the `starting_after` parameter. The cursor is a Base64-encoded JSON array containing `[updated_at, id]` of the last item from the previous page. **Placeholder Transformation** The API transforms Intercom placeholders to a more standard XML-like format: - From: `{{user.name | fallback: 'there'}}` - To: ``
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.macros.list_macros( per_page=1, starting_after="WzE3MTk0OTM3NTcuMCwgIjEyMyJd", updated_since=1000000, ) ```
#### ⚙️ Parameters
**per_page:** `typing.Optional[int]` — The number of results per page
**starting_after:** `typing.Optional[str]` — Base64-encoded cursor containing [updated_at, id] for pagination
**updated_since:** `typing.Optional[int]` — Unix timestamp to filter macros updated after this time
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.macros.get_macro(...)
#### 📝 Description
You can fetch a single macro (saved reply) by its ID. The macro will only be returned if it is visible to the authenticated user based on its visibility settings. **Visibility Rules** A macro is returned based on its `visible_to` setting: - `everyone`: Always visible to all team members - `specific_teams`: Only visible if the authenticated user belongs to one of the teams specified in `visible_to_team_ids` If a macro exists but is not visible to the authenticated user, a 404 error is returned. **Placeholder Transformation** The API transforms Intercom placeholders to a more standard XML-like format in the `body` field: - From: `{{user.name | fallback: 'there'}}` - To: `` Default values in placeholders are HTML-escaped for security.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.macros.get_macro( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of the macro
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Messages
client.unstable.messages.create_message(...)
#### 📝 Description
You can create a message that has been initiated by an admin. The conversation can be either an in-app message, an email, sms or whatsapp. > 🚧 Sending for visitors > > There can be a short delay between when a contact is created and when a contact becomes available to be messaged through the API. A 404 Not Found error will be returned in this case. This will return the Message model that has been created. > 🚧 Retrieving Associated Conversations > > As this is a message, there will be no conversation present until the contact responds. Once they do, you will have to search for a contact's conversations with the id of the message.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.messages.create_message( request={ "from": {"type": "admin", "id": "991267821"}, "to": {"type": "user", "id": "6762f23b1bb69f9f2193bc1d"}, "message_type": "sms", "body": "heyy https://picsum.photos/200/300", }, ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[CreateMessageRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.messages.get_whats_app_message_status(...)
#### 📝 Description
Retrieves statuses of messages sent from the Outbound module. Currently, this API only supports WhatsApp messages. This endpoint returns paginated status events for WhatsApp messages sent via the Outbound module, providing information about delivery state and related message details.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.messages.get_whats_app_message_status( ruleset_id="ruleset_id", per_page=1, starting_after="starting_after", ) ```
#### ⚙️ Parameters
**ruleset_id:** `str` — The unique identifier for the set of messages to check status for
**per_page:** `typing.Optional[int]` — Number of results per page (default 50, max 100)
**starting_after:** `typing.Optional[str]` — Cursor for pagination, used to fetch the next page of results
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## News
client.unstable.news.list_news_items()
#### 📝 Description
You can fetch a list of all news items
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.list_news_items() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.create_news_item(...)
#### 📝 Description
You can create a news item
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable.news import NewsfeedAssignment client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.create_news_item( title="Halloween is here!", body="

New costumes in store for this spooky season

", sender_id=991267834, state="live", deliver_silently=True, labels=["Product", "Update", "New"], reactions=["😆", "😅"], newsfeed_assignments=[ NewsfeedAssignment( newsfeed_id=53, published_at=1664638214, ) ], ) ```
#### ⚙️ Parameters
**title:** `str` — The title of the news item.
**sender_id:** `int` — The id of the sender of the news item. Must be a teammate on the workspace.
**body:** `typing.Optional[str]` — The news item body, which may contain HTML.
**state:** `typing.Optional[NewsItemRequestState]` — News items will not be visible to your users in the assigned newsfeeds until they are set live.
**deliver_silently:** `typing.Optional[bool]` — When set to `true`, the news item will appear in the messenger newsfeed without showing a notification badge.
**labels:** `typing.Optional[typing.Sequence[str]]` — Label names displayed to users to categorize the news item.
**reactions:** `typing.Optional[typing.Sequence[typing.Optional[str]]]` — Ordered list of emoji reactions to the news item. When empty, reactions are disabled.
**newsfeed_assignments:** `typing.Optional[typing.Sequence[NewsfeedAssignment]]` — A list of newsfeed_assignments to assign to the specified newsfeed.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.retrieve_news_item(...)
#### 📝 Description
You can fetch the details of a single news item.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.retrieve_news_item( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the news item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.update_news_item(...)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.update_news_item( id=1, title="Christmas is here!", body="

New gifts in store for the jolly season

", sender_id=991267848, reactions=["😝", "😂"], ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the news item which is given by Intercom.
**title:** `str` — The title of the news item.
**sender_id:** `int` — The id of the sender of the news item. Must be a teammate on the workspace.
**body:** `typing.Optional[str]` — The news item body, which may contain HTML.
**state:** `typing.Optional[NewsItemRequestState]` — News items will not be visible to your users in the assigned newsfeeds until they are set live.
**deliver_silently:** `typing.Optional[bool]` — When set to `true`, the news item will appear in the messenger newsfeed without showing a notification badge.
**labels:** `typing.Optional[typing.Sequence[str]]` — Label names displayed to users to categorize the news item.
**reactions:** `typing.Optional[typing.Sequence[typing.Optional[str]]]` — Ordered list of emoji reactions to the news item. When empty, reactions are disabled.
**newsfeed_assignments:** `typing.Optional[typing.Sequence[NewsfeedAssignment]]` — A list of newsfeed_assignments to assign to the specified newsfeed.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.delete_news_item(...)
#### 📝 Description
You can delete a single news item.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.delete_news_item( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The unique identifier for the news item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.list_live_newsfeed_items(...)
#### 📝 Description
You can fetch a list of all news items that are live on a given newsfeed
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.list_live_newsfeed_items( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the news feed item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.list_newsfeeds()
#### 📝 Description
You can fetch a list of all newsfeeds
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.list_newsfeeds() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.news.retrieve_newsfeed(...)
#### 📝 Description
You can fetch the details of a single newsfeed
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.news.retrieve_newsfeed( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the news feed item which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Segments
client.unstable.segments.list_segments(...)
#### 📝 Description
You can fetch a list of all segments.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.segments.list_segments( include_count=True, ) ```
#### ⚙️ Parameters
**include_count:** `typing.Optional[bool]` — It includes the count of contacts that belong to each segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.segments.retrieve_segment(...)
#### 📝 Description
You can fetch the details of a single segment.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.segments.retrieve_segment( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identified of a given segment.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Switch
client.unstable.switch.create_phone_switch(...)
#### 📝 Description
You can use the API to deflect phone calls to the Intercom Messenger. Calling this endpoint will send an SMS with a link to the Messenger to the phone number specified. If custom attributes are specified, they will be added to the user or lead's custom data attributes.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.switch.create_phone_switch( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Calls
client.unstable.calls.list_calls(...)
#### 📝 Description
Retrieve a paginated list of calls.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.list_calls( page=1, per_page=1, ) ```
#### ⚙️ Parameters
**page:** `typing.Optional[int]` — The page of results to fetch. Defaults to first page
**per_page:** `typing.Optional[int]` — How many results to display per page. Defaults to 25. Max 25.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.show_call(...)
#### 📝 Description
Retrieve a single call by id.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.show_call( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The id of the call to retrieve
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.show_call_recording(...)
#### 📝 Description
Redirects to a signed URL for the call's recording if it exists.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.show_call_recording( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The id of the call
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.show_call_transcript(...)
#### 📝 Description
Returns the transcript for the specified call as a downloadable text file.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.show_call_transcript( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The id of the call
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.list_calls_with_transcripts(...)
#### 📝 Description
Retrieve calls by a list of conversation ids and include transcripts when available. A maximum of 20 `conversation_ids` can be provided. If none are provided or more than 20 are provided, a 400 error is returned.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.list_calls_with_transcripts( conversation_ids=["64619700005694", "64619700005695"], ) ```
#### ⚙️ Parameters
**conversation_ids:** `typing.Sequence[str]` — A list of conversation ids to fetch calls for. Maximum 20.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.register_fin_voice_call(...)
#### 📝 Description
Register a Fin Voice call with Intercom. This endpoint creates an external reference that links an external call identifier to an Intercom call and conversation. The call can be from different sources: - AWS Connect (default) - Five9 - Zoom Phone
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import RegisterFinVoiceCallRequest client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.register_fin_voice_call( request=RegisterFinVoiceCallRequest( phone_number="+1234567890", call_id="call-123-abc", ), ) ```
#### ⚙️ Parameters
**request:** `typing.Optional[RegisterFinVoiceCallRequest]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.collect_fin_voice_call_by_id(...)
#### 📝 Description
Retrieve information about a Fin Voice call using the external reference ID.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.collect_fin_voice_call_by_id( id=1, ) ```
#### ⚙️ Parameters
**id:** `int` — The external reference ID
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.collect_fin_voice_call_by_external_id(...)
#### 📝 Description
Retrieve information about a Fin Voice call using the external call identifier.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.collect_fin_voice_call_by_external_id( external_id="external_id", ) ```
#### ⚙️ Parameters
**external_id:** `str` — The external call identifier from the call provider
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.calls.collect_fin_voice_call_by_phone_number(...)
#### 📝 Description
Retrieve information about a Fin Voice call using the phone number. Returns the most recent matched call for the given phone number, ordered by creation date.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.calls.collect_fin_voice_call_by_phone_number( phone_number="phone_number", ) ```
#### ⚙️ Parameters
**phone_number:** `str` — Phone number in E.164 format
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Teams
client.unstable.teams.list_teams()
#### 📝 Description
This will return a list of team objects for the App.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.teams.list_teams() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.teams.retrieve_team(...)
#### 📝 Description
You can fetch the details of a single team, containing an array of admins that belong to this team.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.teams.retrieve_team( id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of a given team.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Ticket States
client.unstable.ticket_states.list_ticket_states()
#### 📝 Description
You can get a list of all ticket states for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_states.list_ticket_states() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Ticket Type Attributes
client.unstable.ticket_type_attributes.create_ticket_type_attribute(...)
#### 📝 Description
You can create a new attribute for a ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_type_attributes.create_ticket_type_attribute( ticket_type_id="ticket_type_id", name="Attribute Title", description="Attribute Description", data_type="string", required_to_create=False, ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**name:** `str` — The name of the ticket type attribute
**description:** `str` — The description of the attribute presented to the teammate or contact
**data_type:** `CreateTicketTypeAttributeRequestDataType` — The data type of the attribute
**required_to_create:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when teammates are creating the ticket in Inbox.
**required_to_create_for_contacts:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when contacts are creating the ticket in Messenger.
**visible_on_create:** `typing.Optional[bool]` — Whether the attribute is visible to teammates when creating a ticket in Inbox.
**visible_to_contacts:** `typing.Optional[bool]` — Whether the attribute is visible to contacts when creating a ticket in Messenger.
**multiline:** `typing.Optional[bool]` — Whether the attribute allows multiple lines of text (only applicable to string attributes)
**list_items:** `typing.Optional[str]` — A comma delimited list of items for the attribute value (only applicable to list attributes)
**allow_multiple_values:** `typing.Optional[bool]` — Whether the attribute allows multiple files to be attached to it (only applicable to file attributes)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ticket_type_attributes.update_ticket_type_attribute(...)
#### 📝 Description
You can update an existing attribute for a ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_type_attributes.update_ticket_type_attribute( ticket_type_id="ticket_type_id", id="id", description="New Attribute Description", ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**id:** `str` — The unique identifier for the ticket type attribute which is given by Intercom.
**name:** `typing.Optional[str]` — The name of the ticket type attribute
**description:** `typing.Optional[str]` — The description of the attribute presented to the teammate or contact
**required_to_create:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when teammates are creating the ticket in Inbox.
**required_to_create_for_contacts:** `typing.Optional[bool]` — Whether the attribute is required to be filled in when contacts are creating the ticket in Messenger.
**visible_on_create:** `typing.Optional[bool]` — Whether the attribute is visible to teammates when creating a ticket in Inbox.
**visible_to_contacts:** `typing.Optional[bool]` — Whether the attribute is visible to contacts when creating a ticket in Messenger.
**multiline:** `typing.Optional[bool]` — Whether the attribute allows multiple lines of text (only applicable to string attributes)
**list_items:** `typing.Optional[str]` — A comma delimited list of items for the attribute value (only applicable to list attributes)
**allow_multiple_values:** `typing.Optional[bool]` — Whether the attribute allows multiple files to be attached to it (only applicable to file attributes)
**archived:** `typing.Optional[bool]` — Whether the attribute should be archived and not shown during creation of the ticket (it will still be present on previously created tickets)
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Ticket Types
client.unstable.ticket_types.list_ticket_types()
#### 📝 Description
You can get a list of all ticket types for a workspace.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_types.list_ticket_types() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ticket_types.create_ticket_type(...)
#### 📝 Description
You can create a new ticket type. > 📘 Creating ticket types. > > Every ticket type will be created with two default attributes: _default_title_ and _default_description_. > For the `icon` propery, use an emoji from [Twemoji Cheatsheet](https://twemoji-cheatsheet.vercel.app/)
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_types.create_ticket_type( request={"key": "value"}, ) ```
#### ⚙️ Parameters
**request:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.ticket_types.get_ticket_type(...)
#### 📝 Description
You can fetch the details of a single ticket type.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.ticket_types.get_ticket_type( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the ticket type which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Tickets
client.unstable.tickets.reply_ticket(...)
#### 📝 Description
You can reply to a ticket with a message from an admin or on behalf of a contact, or with a note for admins.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ContactReplyTicketIntercomUserIdRequest client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.reply_ticket( id="123", request=ContactReplyTicketIntercomUserIdRequest( body="Thanks again :)", intercom_user_id="6762f2a41bb69f9f2193bc4c", ), ) ```
#### ⚙️ Parameters
**id:** `str`
**request:** `ReplyTicketRequestBody`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tickets.enqueue_create_ticket(...)
#### 📝 Description
Enqueues ticket creation for asynchronous processing, returning if the job was enqueued successfully to be processed. We attempt to perform a best-effort validation on inputs before tasks are enqueued. If the given parameters are incorrect, we won't enqueue the job.
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import CreateTicketRequestContactsItemId client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.enqueue_create_ticket( ticket_type_id="1234", contacts=[ CreateTicketRequestContactsItemId( id="6762f2d81bb69f9f2193bc54", ) ], ) ```
#### ⚙️ Parameters
**ticket_type_id:** `str` — The ID of the type of ticket you want to create
**contacts:** `typing.Sequence[CreateTicketRequestContactsItem]` — The list of contacts (users or leads) affected by this ticket. Currently only one is allowed
**skip_notifications:** `typing.Optional[bool]` — Option to disable notifications when a Ticket is created.
**conversation_to_link_id:** `typing.Optional[str]` The ID of the conversation you want to link to the ticket. Here are the valid ways of linking two tickets: - conversation | back-office ticket - customer tickets | non-shared back-office ticket - conversation | tracker ticket - customer ticket | tracker ticket
**company_id:** `typing.Optional[str]` — The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom
**created_at:** `typing.Optional[int]` — The time the ticket was created. If not provided, the current time will be used.
**assignment:** `typing.Optional[CreateTicketRequestAssignment]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tickets.get_ticket(...)
#### 📝 Description
You can fetch the details of a single ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.get_ticket( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the ticket which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tickets.update_ticket(...)
#### 📝 Description
You can update a ticket.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.update_ticket( id="id", ticket_state_id="123", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the ticket which is given by Intercom
**ticket_attributes:** `typing.Optional[typing.Dict[str, typing.Any]]` — The attributes set on the ticket.
**ticket_state_id:** `typing.Optional[str]` — The ID of the ticket state associated with the ticket type.
**company_id:** `typing.Optional[str]` — The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom. Set to nil to remove company.
**open:** `typing.Optional[bool]` — Specify if a ticket is open. Set to false to close a ticket. Closing a ticket will also unsnooze it.
**is_shared:** `typing.Optional[bool]` — Specify whether the ticket is visible to users.
**snoozed_until:** `typing.Optional[int]` — The time you want the ticket to reopen.
**admin_id:** `typing.Optional[int]` — The ID of the admin performing ticket update. Needed for workflows execution and attributing actions to specific admins.
**assignee_id:** `typing.Optional[str]` — The ID of the admin or team to which the ticket is assigned. Set this 0 to unassign it.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tickets.delete_ticket(...)
#### 📝 Description
You can delete a ticket using the Intercom provided ID.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.delete_ticket( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier for the ticket which is given by Intercom.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.tickets.search_tickets(...)
#### 📝 Description
You can search for multiple tickets by the value of their attributes in order to fetch exactly which ones you want. To search for tickets, you send a `POST` request to `https://api.intercom.io/tickets/search`. This will accept a query object in the body which will define your filters. {% admonition type="warning" name="Optimizing search queries" %} Search queries can be complex, so optimizing them can help the performance of your search. Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize 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/#example-search-conversations-request) for more details on how to use the `starting_after` param. {% /admonition %} ### Nesting & Limitations You can nest these filters in order to get even more granular insights that pinpoint exactly what you need. Example: (1 OR 2) AND (3 OR 4). There are some limitations to the amount of multiples there can be: - There's a limit of max 2 nested filters - There's a limit of max 15 filters for each AND or OR group ### Accepted Fields Most keys listed as part of the Ticket model are searchable, whether writeable or not. The value you search for has to match the accepted type, otherwise the query will fail (ie. as `created_at` accepts a date, the `value` cannot be a string such as `"foobar"`). The `source.body` field is unique as the search will not be performed against the entire value, but instead against every element of the value separately. For example, when searching for a conversation with a `"I need support"` body - the query should contain a `=` operator with the value `"support"` for such conversation to be returned. A query with a `=` operator and a `"need support"` value will not yield a result. | Field | Type | | :---------------------------------------- | :--------------------------------------------------------------------------------------- | | id | String | | created_at | Date (UNIX timestamp) | | updated_at | Date (UNIX timestamp) | | title | String | | description | String | | category | String | | ticket_type_id | String | | contact_ids | String | | teammate_ids | String | | admin_assignee_id | String | | team_assignee_id | String | | open | Boolean | | state | String | | snoozed_until | Date (UNIX timestamp) | | ticket_attribute.{id} | String or Boolean or Date (UNIX timestamp) or Float or Integer | {% admonition type="info" name="Searching by Category" %} When searching for tickets by the **`category`** field, specific terms must be used instead of the category names: * For **Customer** category tickets, use the term `request`. * For **Back-office** category tickets, use the term `task`. * For **Tracker** category tickets, use the term `tracker`. {% /admonition %} ### Accepted Operators {% admonition type="info" name="Searching based on `created_at`" %} You may use the `<=` or `>=` operators to search by `created_at`. {% /admonition %} The table below shows the operators you can use to define how you want to search for the value. The operator should be put in as a string (`"="`). The operator has to be compatible with the field's type (eg. you cannot search with `>` for a given string value as it's only compatible for integer's and dates). | Operator | Valid Types | Description | | :------- | :----------------------------- | :----------------------------------------------------------- | | = | All | Equals | | != | All | Doesn't Equal | | IN | All | In Shortcut for `OR` queries Values most be in Array | | NIN | All | Not In Shortcut for `OR !` queries Values must be in Array | | > | Integer Date (UNIX Timestamp) | Greater (or equal) than | | < | Integer Date (UNIX Timestamp) | Lower (or equal) than | | ~ | String | Contains | | !~ | String | Doesn't Contain | | ^ | String | Starts With | | $ | String | Ends With |
#### 🔌 Usage
```python from intercom import Intercom from intercom.unstable import ( MultipleFilterSearchRequest, SingleFilterSearchRequest, StartingAfterPaging, ) client = Intercom( token="YOUR_TOKEN", ) client.unstable.tickets.search_tickets( query=MultipleFilterSearchRequest( operator="AND", value=[ SingleFilterSearchRequest( field="created_at", operator=">", value="1306054154", ) ], ), pagination=StartingAfterPaging( per_page=5, ), ) ```
#### ⚙️ Parameters
**query:** `SearchRequestQuery`
**pagination:** `typing.Optional[StartingAfterPaging]`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Visitors
client.unstable.visitors.retrieve_visitor_with_user_id(...)
#### 📝 Description
You can fetch the details of a single visitor.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.visitors.retrieve_visitor_with_user_id( user_id="user_id", ) ```
#### ⚙️ Parameters
**user_id:** `str` — The user_id of the Visitor you want to retrieve.
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.visitors.update_visitor(...)
#### 📝 Description
Sending a PUT request to `/visitors` will result in an update of an existing Visitor. **Option 1.** You can update a visitor by passing in the `user_id` of the visitor in the Request body. **Option 2.** You can update a visitor by passing in the `id` of the visitor in the Request body.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.visitors.update_visitor( request={"user_id": "fail", "name": "Christian Fail"}, ) ```
#### ⚙️ Parameters
**request:** `UpdateVisitorRequestOne`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.visitors.convert_visitor(...)
#### 📝 Description
You can merge a Visitor to a Contact of role type `lead` or `user`. > 📘 What happens upon a visitor being converted? > > If the User exists, then the Visitor will be merged into it, the Visitor deleted and the User returned. If the User does not exist, the Visitor will be converted to a User, with the User identifiers replacing it's Visitor identifiers.
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.visitors.convert_visitor( type="user", user={"email": "foo@bar.com"}, visitor={"user_id": "3ecf64d0-9ed1-4e9f-88e1-da7d6e6782f3"}, ) ```
#### ⚙️ Parameters
**type:** `str` — Represents the role of the Contact model. Accepts `lead` or `user`.
**user:** `typing.Any`
**visitor:** `typing.Any`
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Brands
client.unstable.brands.list_brands()
#### 📝 Description
Retrieves all brands for the workspace, including the default brand. The default brand id always matches the workspace
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.brands.list_brands() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.brands.retrieve_brand(...)
#### 📝 Description
Fetches a specific brand by its unique identifier
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.brands.retrieve_brand( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of the brand
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
## Emails
client.unstable.emails.list_emails()
#### 📝 Description
Lists all sender email address settings for the workspace
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.emails.list_emails() ```
#### ⚙️ Parameters
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
client.unstable.emails.retrieve_email(...)
#### 📝 Description
Fetches a specific email setting by its unique identifier
#### 🔌 Usage
```python from intercom import Intercom client = Intercom( token="YOUR_TOKEN", ) client.unstable.emails.retrieve_email( id="id", ) ```
#### ⚙️ Parameters
**id:** `str` — The unique identifier of the email setting
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.