client.admins.identify() -> Intercom.AdminWithApp
-
-
-
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.
-
-
-
await client.admins.identify();
-
-
-
requestOptions:
Admins.RequestOptions
-
-
client.admins.away({ ...params }) -> Intercom.Admin
-
-
-
You can set an Admin as away for the Inbox.
-
-
-
await client.admins.away({ admin_id: "admin_id", away_mode_enabled: true, away_mode_reassign: true, });
-
-
-
request:
Intercom.ConfigureAwayAdminRequest
-
requestOptions:
Admins.RequestOptions
-
-
client.admins.listAllActivityLogs({ ...params }) -> Intercom.ActivityLogList
-
-
-
You can get a log of activities by all admins in an app.
-
-
-
await client.admins.listAllActivityLogs({ created_at_after: "1677253093", created_at_before: "1677861493", });
-
-
-
request:
Intercom.ListAllActivityLogsRequest
-
requestOptions:
Admins.RequestOptions
-
-
client.admins.list() -> Intercom.AdminList
-
-
-
You can fetch a list of admins for a given workspace.
-
-
-
await client.admins.list();
-
-
-
requestOptions:
Admins.RequestOptions
-
-
client.admins.find({ ...params }) -> Intercom.Admin
-
-
-
You can retrieve the details of a single admin.
-
-
-
await client.admins.find({ admin_id: "123", });
-
-
-
request:
Intercom.FindAdminRequest
-
requestOptions:
Admins.RequestOptions
-
-
client.articles.list({ ...params }) -> core.Page
-
-
-
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.
-
-
-
const response = await client.articles.list(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.articles.list(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListArticlesRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.articles.create({ ...params }) -> Intercom.Article
-
-
-
You can create a new article by making a POST request to
https://api.intercom.io/articles
.
-
-
-
await client.articles.create({ title: "Thanks for everything", description: "Description of the Article", body: "Body of the Article", author_id: 991267407, state: "published", parent_id: 145, parent_type: "collection", translated_content: { fr: { type: "article_content", title: "Merci pour tout", description: "Description de l'article", body: "Corps de l'article", author_id: 991267407, state: "published", }, }, });
-
-
-
request:
Intercom.CreateArticleRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.articles.find({ ...params }) -> Intercom.Article
-
-
-
You can fetch the details of a single article by making a GET request to
https://api.intercom.io/articles/<id>
.
-
-
-
await client.articles.find({ article_id: "123", });
-
-
-
request:
Intercom.FindArticleRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.articles.update({ ...params }) -> Intercom.Article
-
-
-
You can update the details of a single article by making a PUT request to
https://api.intercom.io/articles/<id>
.
-
-
-
await client.articles.update({ article_id: "123", title: "Christmas is here!", body: "<p>New gifts in store for the jolly season</p>", });
-
-
-
request:
Intercom.UpdateArticleRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.articles.delete({ ...params }) -> Intercom.DeletedArticleObject
-
-
-
You can delete a single article by making a DELETE request to
https://api.intercom.io/articles/<id>
.
-
-
-
await client.articles.delete({ article_id: "123", });
-
-
-
request:
Intercom.DeleteArticleRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.articles.search({ ...params }) -> Intercom.SearchArticlesResponse
-
-
-
You can search for articles by making a GET request to
https://api.intercom.io/articles/search
.
-
-
-
await client.articles.search({ phrase: "Getting started", state: "published", });
-
-
-
request:
Intercom.SearchArticlesRequest
-
requestOptions:
Articles.RequestOptions
-
-
client.helpCenters.find({ ...params }) -> Intercom.HelpCenter
-
-
-
You can fetch the details of a single Help Center by making a GET request to
https://api.intercom.io/help_center/help_center/<id>
.
-
-
-
await client.helpCenters.find({ help_center_id: "123", });
-
-
-
request:
Intercom.FindHelpCenterRequest
-
requestOptions:
HelpCenters.RequestOptions
-
-
client.helpCenters.list({ ...params }) -> core.Page
-
-
-
You can list all Help Centers by making a GET request to
https://api.intercom.io/help_center/help_centers
.
-
-
-
const response = await client.helpCenters.list(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.helpCenters.list(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListHelpCentersRequest
-
requestOptions:
HelpCenters.RequestOptions
-
-
client.companies.retrieve({ ...params }) -> Intercom.CompanyList
-
-
-
You can fetch a single company by passing in
company_id
orname
.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
ortag_id
as a query parameter.https://api.intercom.io/companies?tag_id={tag_id}
https://api.intercom.io/companies?segment_id={segment_id}
-
-
-
await client.companies.retrieve({ name: "my company", company_id: "12345", tag_id: "678910", segment_id: "98765", });
-
-
-
request:
Intercom.RetrieveCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.createOrUpdate({ ...params }) -> Intercom.Company
-
-
-
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 aPOST
request, if not found viacompany_id
, the new company will be created, if found, that company will be updated.{% admonition type="attention" name="Using
company_id
" %} You can set a uniquecompany_id
value when creating a company. However, it is not possible to updatecompany_id
. Be sure to set a unique value once upon creation of the company. {% /admonition %}
-
-
-
await client.companies.createOrUpdate({ name: "my company", company_id: "company_remote_id", remote_created_at: 1374138000, });
-
-
-
request:
Intercom.CreateOrUpdateCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.find({ ...params }) -> Intercom.Company
-
-
-
You can fetch a single company.
-
-
-
await client.companies.find({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", });
-
-
-
request:
Intercom.FindCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.update({ ...params }) -> Intercom.Company
-
-
-
You can update a single company using the Intercom provisioned
id
.{% admonition type="attention" name="Using
company_id
" %} When updating a company it is not possible to updatecompany_id
. This can only be set once upon creation of the company. {% /admonition %}
-
-
-
await client.companies.update({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", });
-
-
-
request:
Intercom.UpdateCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.delete({ ...params }) -> Intercom.DeletedCompanyObject
-
-
-
You can delete a single company.
-
-
-
await client.companies.delete({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", });
-
-
-
request:
Intercom.DeleteCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.listAttachedContacts({ ...params }) -> Intercom.CompanyAttachedContacts
-
-
-
You can fetch a list of all contacts that belong to a company.
-
-
-
await client.companies.listAttachedContacts({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", });
-
-
-
request:
Intercom.ListAttachedContactsRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.listAttachedSegments({ ...params }) -> Intercom.CompanyAttachedSegments
-
-
-
You can fetch a list of all segments that belong to a company.
-
-
-
await client.companies.listAttachedSegments({ company_id: "5f4d3c1c-7b1b-4d7d-a97e-6095715c6632", });
-
-
-
request:
Intercom.ListSegmentsAttachedToCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.list({ ...params }) -> core.Page
-
-
-
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. {% 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 for more details on how to use thestarting_after
param. {% /admonition %}
-
-
-
const response = await client.companies.list({ order: "desc", }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.companies.list({ order: "desc", }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListCompaniesRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.scroll({ ...params }) -> core.Page
-
-
-
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 %}
-
-
-
const response = await client.companies.scroll(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.companies.scroll(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ScrollCompaniesRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.attachContact({ ...params }) -> Intercom.Company
-
-
-
You can attach a company to a single contact.
-
-
-
await client.companies.attachContact({ contact_id: "contact_id", id: "667d608d8a68186f43bafd70", });
-
-
-
request:
Intercom.AttachContactToCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.companies.detachContact({ ...params }) -> Intercom.Company
-
-
-
You can detach a company from a single contact.
-
-
-
await client.companies.detachContact({ contact_id: "58a430d35458202d41b1e65b", company_id: "58a430d35458202d41b1e65b", });
-
-
-
request:
Intercom.DetachContactFromCompanyRequest
-
requestOptions:
Companies.RequestOptions
-
-
client.contacts.listAttachedCompanies({ ...params }) -> core.Page
-
-
-
You can fetch a list of companies that are associated to a contact.
-
-
-
const response = await client.contacts.listAttachedCompanies({ contact_id: "63a07ddf05a32042dffac965", }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.contacts.listAttachedCompanies({ contact_id: "63a07ddf05a32042dffac965", }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListAttachedCompaniesRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.listAttachedSegments({ ...params }) -> Intercom.ContactSegments
-
-
-
You can fetch a list of segments that are associated to a contact.
-
-
-
await client.contacts.listAttachedSegments({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.ListSegmentsAttachedToContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.listAttachedSubscriptions({ ...params }) -> Intercom.SubscriptionTypeList
-
-
-
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.
-
-
-
await client.contacts.listAttachedSubscriptions({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.ListAttachedSubscriptionsRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.attachSubscription({ ...params }) -> Intercom.SubscriptionType
-
-
-
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.
-
-
-
await client.contacts.attachSubscription({ contact_id: "63a07ddf05a32042dffac965", id: "37846", consent_type: "opt_in", });
-
-
-
request:
Intercom.AttachSubscriptionToContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.detachSubscription({ ...params }) -> Intercom.SubscriptionType
-
-
-
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.
-
-
-
await client.contacts.detachSubscription({ contact_id: "63a07ddf05a32042dffac965", subscription_id: "37846", });
-
-
-
request:
Intercom.DetachSubscriptionFromContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.listAttachedTags({ ...params }) -> Intercom.TagList
-
-
-
You can fetch a list of all tags that are attached to a specific contact.
-
-
-
await client.contacts.listAttachedTags({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.ListTagsAttachedToContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.find({ ...params }) -> Intercom.Contact
-
-
-
You can fetch the details of a single contact.
-
-
-
await client.contacts.find({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.FindContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.update({ ...params }) -> Intercom.Contact
-
-
-
You can update an existing contact (ie. user or lead).
-
-
-
await client.contacts.update({ contact_id: "63a07ddf05a32042dffac965", email: "joebloggs@intercom.io", name: "joe bloggs", });
-
-
-
request:
Intercom.UpdateContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.delete({ ...params }) -> Intercom.ContactDeleted
-
-
-
You can delete a single contact.
-
-
-
await client.contacts.delete({ contact_id: "contact_id", });
-
-
-
request:
Intercom.DeleteContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.mergeLeadInUser({ ...params }) -> Intercom.Contact
-
-
-
You can merge a contact with a
role
oflead
into a contact with arole
ofuser
.
-
-
-
await client.contacts.mergeLeadInUser({ from: "667d60ac8a68186f43bafdbb", into: "667d60ac8a68186f43bafdbc", });
-
-
-
request:
Intercom.MergeContactsRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.search({ ...params }) -> core.Page
-
-
-
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 tohttps://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
andOR
operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is50
results per page. See the pagination section for more details on how to use thestarting_after
param. {% /admonition %}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.
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
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.
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, thevalue
cannot be a string such as"foorbar"
).Field Type id String role String
Accepts user or leadname 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 {% admonition type="attention" name="Searching based on
created_at
" %} You cannot use the<=
or>=
operators to search bycreated_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 forOR
queries
Values must be in ArrayNIN All Not In
Shortcut forOR !
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
-
-
-
const response = await client.contacts.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.contacts.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.SearchRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.list({ ...params }) -> core.Page
-
-
-
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 for more details on how to use thestarting_after
param. {% /admonition %}
-
-
-
const response = await client.contacts.list(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.contacts.list(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListContactsRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.create({ ...params }) -> Intercom.Contact
-
-
-
You can create a new contact (ie. user or lead).
-
-
-
await client.contacts.create({ email: "joebloggs@intercom.io", });
-
-
-
request:
Intercom.CreateContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.archive({ ...params }) -> Intercom.ContactArchived
-
-
-
You can archive a single contact.
-
-
-
await client.contacts.archive({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.ArchiveContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.contacts.unarchive({ ...params }) -> Intercom.ContactUnarchived
-
-
-
You can unarchive a single contact.
-
-
-
await client.contacts.unarchive({ contact_id: "63a07ddf05a32042dffac965", });
-
-
-
request:
Intercom.UnarchiveContactRequest
-
requestOptions:
Contacts.RequestOptions
-
-
client.notes.list({ ...params }) -> core.Page
-
-
-
You can fetch a list of notes that are associated to a contact.
-
-
-
const response = await client.notes.list({ contact_id: "contact_id", }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.notes.list({ contact_id: "contact_id", }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListContactNotesRequest
-
requestOptions:
Notes.RequestOptions
-
-
client.notes.create({ ...params }) -> Intercom.Note
-
-
-
You can add a note to a single contact.
-
-
-
await client.notes.create({ contact_id: "123", body: "Hello", admin_id: "123", });
-
-
-
request:
Intercom.CreateContactNoteRequest
-
requestOptions:
Notes.RequestOptions
-
-
client.notes.find({ ...params }) -> Intercom.Note
-
-
-
You can fetch the details of a single note.
-
-
-
await client.notes.find({ note_id: "1", });
-
-
-
request:
Intercom.FindNoteRequest
-
requestOptions:
Notes.RequestOptions
-
-
client.tags.tagContact({ ...params }) -> Intercom.Tag
-
-
-
You can tag a specific contact. This will return a tag object for the tag that was added to the contact.
-
-
-
await client.tags.tagContact({ contact_id: "63a07ddf05a32042dffac965", id: "7522907", });
-
-
-
request:
Intercom.TagContactRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.untagContact({ ...params }) -> Intercom.Tag
-
-
-
You can remove tag from a specific contact. This will return a tag object for the tag that was removed from the contact.
-
-
-
await client.tags.untagContact({ contact_id: "63a07ddf05a32042dffac965", tag_id: "7522907", });
-
-
-
request:
Intercom.UntagContactRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.tagConversation({ ...params }) -> Intercom.Tag
-
-
-
You can tag a specific conversation. This will return a tag object for the tag that was added to the conversation.
-
-
-
await client.tags.tagConversation({ conversation_id: "64619700005694", id: "7522907", admin_id: "780", });
-
-
-
request:
Intercom.TagConversationRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.untagConversation({ ...params }) -> Intercom.Tag
-
-
-
You can remove tag from a specific conversation. This will return a tag object for the tag that was removed from the conversation.
-
-
-
await client.tags.untagConversation({ conversation_id: "64619700005694", tag_id: "7522907", admin_id: "123", });
-
-
-
request:
Intercom.UntagConversationRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.list() -> Intercom.TagList
-
-
-
You can fetch a list of all tags for a given workspace.
-
-
-
await client.tags.list();
-
-
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.create({ ...params }) -> Intercom.Tag
-
-
-
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.
-
-
-
await client.tags.create({ name: "test", });
-
-
-
request:
Intercom.TagsCreateRequestBody
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.find({ ...params }) -> Intercom.Tag
-
-
-
You can fetch the details of tags that are on the workspace by their id. This will return a tag object.
-
-
-
await client.tags.find({ tag_id: "123", });
-
-
-
request:
Intercom.FindTagRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.delete({ ...params }) -> void
-
-
-
You can delete the details of tags that are on the workspace by passing in the id.
-
-
-
await client.tags.delete({ tag_id: "123", });
-
-
-
request:
Intercom.DeleteTagRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.tagTicket({ ...params }) -> Intercom.Tag
-
-
-
You can tag a specific ticket. This will return a tag object for the tag that was added to the ticket.
-
-
-
await client.tags.tagTicket({ ticket_id: "64619700005694", id: "7522907", admin_id: "780", });
-
-
-
request:
Intercom.TagTicketRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.tags.untagTicket({ ...params }) -> Intercom.Tag
-
-
-
You can remove tag from a specific ticket. This will return a tag object for the tag that was removed from the ticket.
-
-
-
await client.tags.untagTicket({ ticket_id: "64619700005694", tag_id: "7522907", admin_id: "123", });
-
-
-
request:
Intercom.UntagTicketRequest
-
requestOptions:
Tags.RequestOptions
-
-
client.conversations.list({ ...params }) -> core.Page
-
-
-
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 for more details on how to use thestarting_after
param. {% /admonition %}
-
-
-
const response = await client.conversations.list(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.conversations.list(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.ListConversationsRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.create({ ...params }) -> Intercom.Message
-
-
-
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
orid
value in thefrom
field, along with atype
field value ofcontact
. 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.
-
-
-
await client.conversations.create({ from: { type: "user", id: "667d60d18a68186f43bafddd", }, body: "Hello there", });
-
-
-
request:
Intercom.CreateConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.find({ ...params }) -> Intercom.Conversation
-
-
-
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.
-
-
-
await client.conversations.find({ conversation_id: "123", display_as: "plaintext", });
-
-
-
request:
Intercom.FindConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.update({ ...params }) -> Intercom.Conversation
-
-
-
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 %}
-
-
-
await client.conversations.update({ conversation_id: "123", display_as: "plaintext", read: true, custom_attributes: { issue_type: "Billing", priority: "High", }, });
-
-
-
request:
Intercom.UpdateConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.search({ ...params }) -> core.Page
-
-
-
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 tohttps://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
andOR
operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is20
results per page and maximum is150
. See the pagination section for more details on how to use thestarting_after
param. {% /admonition %}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
Most keys listed as part of the The conversation model is 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, thevalue
cannot be a string such as"foorbar"
). Thesource.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 areconversation
,email
,facebook
,instagram
,phone_call
,phone_switch
,push
,sms
,twitter
andwhatsapp
.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 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 ArrayNIN 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
-
-
-
const response = await client.conversations.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.conversations.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.SearchRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.reply({ ...params }) -> Intercom.Conversation
-
-
-
You can reply to a conversation with a message from an admin or on behalf of a contact, or with a note for admins.
-
-
-
await client.conversations.reply({ conversation_id: '123 or "last"', body: { message_type: "comment", type: "user", body: "Thanks again :)", intercom_user_id: "667d60f18a68186f43bafdf4", }, });
-
-
-
request:
Intercom.ReplyToConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.manage({ ...params }) -> Intercom.Conversation
-
-
-
For managing conversations you can:
- Close a conversation
- Snooze a conversation to reopen on a future date
- Open a conversation which is
snoozed
orclosed
- Assign a conversation to an admin and/or team.
-
-
-
await client.conversations.manage({ conversation_id: "123", body: { message_type: "assignment", type: "admin", admin_id: "12345", assignee_id: "4324241", body: "Goodbye :)", }, });
-
-
-
request:
Intercom.ManageConversationPartsRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.runAssignmentRules({ ...params }) -> Intercom.Conversation
-
-
-
You can let a conversation be automatically assigned following assignment rules. {% admonition type="attention" name="When using workflows" %} It is not possible to use this endpoint with Workflows. {% /admonition %}
-
-
-
await client.conversations.runAssignmentRules({ conversation_id: "123", });
-
-
-
request:
Intercom.AutoAssignConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.attachContactAsAdmin({ ...params }) -> Intercom.Conversation
-
-
-
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin.
{% admonition type="attention" 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 tolead
. {% /admonition %}
-
-
-
await client.conversations.attachContactAsAdmin({ conversation_id: "123", admin_id: "12345", customer: { intercom_user_id: "667d61168a68186f43bafe0d", }, });
-
-
-
request:
Intercom.AttachContactToConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.detachContactAsAdmin({ ...params }) -> Intercom.Conversation
-
-
-
You can add participants who are contacts to a conversation, on behalf of either another contact or an admin.
{% admonition type="attention" 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 tolead
. {% /admonition %}
-
-
-
await client.conversations.detachContactAsAdmin({ conversation_id: "123", contact_id: "123", admin_id: "5017690", });
-
-
-
request:
Intercom.DetachContactFromConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.redactConversationPart({ ...params }) -> Intercom.Conversation
-
-
-
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 aconversation_part_not_redactable
error if these criteria are not met. {% /admonition %}
-
-
-
await client.conversations.redactConversationPart({ type: "conversation_part", conversation_id: "19894788788", conversation_part_id: "19381789428", });
-
-
-
request:
Intercom.RedactConversationRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.conversations.convertToTicket({ ...params }) -> Intercom.Ticket
-
-
-
You can convert a conversation to a ticket.
-
-
-
await client.conversations.convertToTicket({ conversation_id: "123", ticket_type_id: "79", });
-
-
-
request:
Intercom.ConvertConversationToTicketRequest
-
requestOptions:
Conversations.RequestOptions
-
-
client.dataAttributes.list({ ...params }) -> Intercom.DataAttributeList
-
-
-
You can fetch a list of all data attributes belonging to a workspace for contacts, companies or conversations.
-
-
-
await client.dataAttributes.list();
-
-
-
request:
Intercom.ListDataAttributesRequest
-
requestOptions:
DataAttributes.RequestOptions
-
-
client.dataAttributes.create({ ...params }) -> Intercom.DataAttribute
-
-
-
You can create a data attributes for a
contact
or acompany
.
-
-
-
await client.dataAttributes.create({ name: "Mithril Shirt", model: "company", data_type: "string", });
-
-
-
request:
Intercom.CreateDataAttributeRequest
-
requestOptions:
DataAttributes.RequestOptions
-
-
client.dataAttributes.update({ ...params }) -> Intercom.DataAttribute
-
-
-
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.
-
-
-
await client.dataAttributes.update({ data_attribute_id: "1", archived: false, description: "Just a plain old ring", options: [ { value: "1-10", }, { value: "11-20", }, ], });
-
-
-
request:
Intercom.UpdateDataAttributeRequest
-
requestOptions:
DataAttributes.RequestOptions
-
-
client.events.list({ ...params }) -> Intercom.DataEventSummary
-
-
-
π§
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 atype
parameter. The identifier parameter can be one ofuser_id
,email
orintercom_user_id
. Thetype
parameter value must beuser
.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 when sending.You can optionally define the result page size as well with the
per_page
parameter.
-
-
-
await client.events.list({ type: "type", });
-
-
-
request:
Intercom.ListEventsRequest
-
requestOptions:
Events.RequestOptions
-
-
client.events.create({ ...params }) -> void
-
-
-
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
ofapplication/json
.When using the JavaScript API, adding the code to 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 thetrack_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, assumed to be in the UTC 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
andvalue
keys."article": {"url": "https://example.org/ab1de.html", "value":"the dude abides"}
Monetary Amount The value is a JSON object that contains amount
andcurrency
keys. Theamount
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.- Successful responses to submitted events return
202 Accepted
with an empty body. - Unauthorised access will be rejected with a
401 Unauthorized
or403 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.
-
-
-
await client.events.create({ id: "8a88a590-e1c3-41e2-a502-e0649dbf721c", event_name: "invited-friend", created_at: 1671028894, });
-
-
-
request:
Intercom.CreateDataEventRequest
-
requestOptions:
Events.RequestOptions
-
-
client.events.summaries({ ...params }) -> void
-
-
-
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.
-
-
-
await client.events.summaries();
-
-
-
request:
Intercom.ListEventSummariesRequest
-
requestOptions:
Events.RequestOptions
-
-
client.dataExport.create({ ...params }) -> Intercom.DataExport
-
-
-
To create your export job, you need to send a
POST
request to the export endpointhttps://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.
-
-
-
await client.dataExport.create({ created_at_after: 1719474967, created_at_before: 1719492967, });
-
-
-
request:
Intercom.CreateDataExportRequest
-
requestOptions:
DataExport.RequestOptions
-
-
client.dataExport.find({ ...params }) -> Intercom.DataExport
-
-
-
You can view the status of your job by sending a
GET
request to the URLhttps://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.
-
-
-
await client.dataExport.find({ job_identifier: "job_identifier", });
-
-
-
request:
Intercom.FindDataExportRequest
-
requestOptions:
DataExport.RequestOptions
-
-
client.dataExport.cancel({ ...params }) -> Intercom.DataExport
-
-
-
You can cancel your job
-
-
-
await client.dataExport.cancel({ job_identifier: "job_identifier", });
-
-
-
request:
Intercom.CancelDataExportRequest
-
requestOptions:
DataExport.RequestOptions
-
-
client.dataExport.download({ ...params }) -> void
-
-
-
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.
-
-
-
await client.dataExport.download({ job_identifier: "job_identifier", });
-
-
-
request:
Intercom.DownloadDataExportRequest
-
requestOptions:
DataExport.RequestOptions
-
-
client.messages.create({ ...params }) -> Intercom.Message
-
-
-
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.
-
-
-
await client.messages.create({ message_type: "inapp", subject: "Thanks for everything", body: "heyy", template: "plain", from: { type: "admin", id: 394051, }, to: { type: "user", id: "536e564f316c83104c000020", }, created_at: 1590000000, create_conversation_without_contact_reply: true, });
-
-
-
request:
Intercom.CreateMessageRequest
-
requestOptions:
Messages.RequestOptions
-
-
client.segments.list({ ...params }) -> Intercom.SegmentList
-
-
-
You can fetch a list of all segments.
-
-
-
await client.segments.list();
-
-
-
request:
Intercom.ListSegmentsRequest
-
requestOptions:
Segments.RequestOptions
-
-
client.segments.find({ ...params }) -> Intercom.Segment
-
-
-
You can fetch the details of a single segment.
-
-
-
await client.segments.find({ segment_id: "123", });
-
-
-
request:
Intercom.FindSegmentRequest
-
requestOptions:
Segments.RequestOptions
-
-
client.subscriptionTypes.list() -> Intercom.SubscriptionTypeList
-
-
-
You can list all subscription types. A list of subscription type objects will be returned.
-
-
-
await client.subscriptionTypes.list();
-
-
-
requestOptions:
SubscriptionTypes.RequestOptions
-
-
client.phoneCallRedirects.create({ ...params }) -> Intercom.PhoneSwitch
-
-
-
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.
-
-
-
await client.phoneCallRedirects.create({ phone: "+353832345678", custom_attributes: { issue_type: "Billing", priority: "High", }, });
-
-
-
request:
Intercom.CreatePhoneCallRedirectRequest
-
requestOptions:
PhoneCallRedirects.RequestOptions
-
-
client.teams.list() -> Intercom.TeamList
-
-
-
This will return a list of team objects for the App.
-
-
-
await client.teams.list();
-
-
-
requestOptions:
Teams.RequestOptions
-
-
client.teams.find({ ...params }) -> Intercom.Team
-
-
-
You can fetch the details of a single team, containing an array of admins that belong to this team.
-
-
-
await client.teams.find({ team_id: "123", });
-
-
-
request:
Intercom.FindTeamRequest
-
requestOptions:
Teams.RequestOptions
-
-
client.ticketTypes.list() -> Intercom.TicketTypeList
-
-
-
You can get a list of all ticket types for a workspace.
-
-
-
await client.ticketTypes.list();
-
-
-
requestOptions:
TicketTypes.RequestOptions
-
-
client.ticketTypes.create({ ...params }) -> Intercom.TicketType
-
-
-
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
-
-
-
await client.ticketTypes.create({ name: "Customer Issue", description: "Customer Report Template", category: "Customer", icon: "\uD83C\uDF9F\uFE0F", });
-
-
-
request:
Intercom.CreateTicketTypeRequest
-
requestOptions:
TicketTypes.RequestOptions
-
-
client.ticketTypes.get({ ...params }) -> Intercom.TicketType
-
-
-
You can fetch the details of a single ticket type.
-
-
-
await client.ticketTypes.get({ ticket_type_id: "ticket_type_id", });
-
-
-
request:
Intercom.FindTicketTypeRequest
-
requestOptions:
TicketTypes.RequestOptions
-
-
client.ticketTypes.update({ ...params }) -> Intercom.TicketType
-
-
-
You can update a ticket type.
π Updating a ticket type.
For the
icon
propery, use an emoji from Twemoji Cheatsheet
-
-
-
await client.ticketTypes.update({ ticket_type_id: "ticket_type_id", name: "Bug Report 2", });
-
-
-
request:
Intercom.UpdateTicketTypeRequest
-
requestOptions:
TicketTypes.RequestOptions
-
-
client.tickets.reply({ ...params }) -> Intercom.TicketReply
-
-
-
You can reply to a ticket with a message from an admin or on behalf of a contact, or with a note for admins.
-
-
-
await client.tickets.reply({ ticket_id: "123", body: { message_type: "comment", type: "user", body: "Thanks again :)", intercom_user_id: "667d619d8a68186f43bafe82", }, });
-
-
-
request:
Intercom.ReplyToTicketRequest
-
requestOptions:
Tickets.RequestOptions
-
-
client.tickets.create({ ...params }) -> Intercom.Ticket
-
-
-
You can create a new ticket.
-
-
-
await client.tickets.create({ ticket_type_id: "1234", contacts: [ { id: "667d61b78a68186f43bafe8d", }, ], ticket_attributes: { _default_title_: "example", _default_description_: "there is a problem", }, });
-
-
-
request:
Intercom.CreateTicketRequest
-
requestOptions:
Tickets.RequestOptions
-
-
client.tickets.get({ ...params }) -> Intercom.Ticket
-
-
-
You can fetch the details of a single ticket.
-
-
-
await client.tickets.get({ ticket_id: "ticket_id", });
-
-
-
request:
Intercom.FindTicketRequest
-
requestOptions:
Tickets.RequestOptions
-
-
client.tickets.update({ ...params }) -> Intercom.Ticket
-
-
-
You can update a ticket.
-
-
-
await client.tickets.update({ ticket_id: "ticket_id", ticket_attributes: { _default_title_: "example", _default_description_: "there is a problem", }, state: "in_progress", open: true, snoozed_until: 1673609604, assignment: { admin_id: "991267883", assignee_id: "991267885", }, });
-
-
-
request:
Intercom.UpdateTicketRequest
-
requestOptions:
Tickets.RequestOptions
-
-
client.tickets.search({ ...params }) -> core.Page
-
-
-
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 tohttps://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
andOR
operators to combine multiple filters to get the exact results you need and utilize pagination to limit the number of results returned. The default is20
results per page. See the pagination section for more details on how to use thestarting_after
param. {% /admonition %}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
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, thevalue
cannot be a string such as"foobar"
).Field Type id String created_at Date (UNIX timestamp) updated_at Date (UNIX timestamp) default_title String default_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 based on
created_at
" %} You may use the<=
or>=
operators to search bycreated_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 ArrayNIN 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
-
-
-
const response = await client.tickets.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.tickets.search({ query: { operator: "AND", value: [ { field: "created_at", operator: ">", value: "1306054154", }, ], }, pagination: { per_page: 5, }, }); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.SearchRequest
-
requestOptions:
Tickets.RequestOptions
-
-
client.visitors.find({ ...params }) -> Intercom.Visitor
-
-
-
You can fetch the details of a single visitor.
-
-
-
await client.visitors.find({ user_id: "user_id", });
-
-
-
request:
Intercom.FindVisitorRequest
-
requestOptions:
Visitors.RequestOptions
-
-
client.visitors.update({ ...params }) -> Intercom.Visitor
-
-
-
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.
-
-
-
await client.visitors.update({ id: "667d61cc8a68186f43bafe95", name: "Gareth Bale", });
-
-
-
request:
Intercom.UpdateVisitorRequest
-
requestOptions:
Visitors.RequestOptions
-
-
client.visitors.mergeToContact({ ...params }) -> Intercom.Contact
-
-
-
You can merge a Visitor to a Contact of role type
lead
oruser
.π 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.
-
-
-
await client.visitors.mergeToContact({ type: "user", user: { id: "8a88a590-e1c3-41e2-a502-e0649dbf721c", email: "foo@bar.com", }, visitor: { user_id: "3ecf64d0-9ed1-4e9f-88e1-da7d6e6782f3", }, });
-
-
-
request:
Intercom.MergeVisitorToContactRequest
-
requestOptions:
Visitors.RequestOptions
-
-
client.helpCenters.collections.list({ ...params }) -> core.Page
-
-
-
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.
-
-
-
const response = await client.helpCenters.collections.list(); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page const page = await client.helpCenters.collections.list(); while (page.hasNextPage()) { page = page.getNextPage(); }
-
-
-
request:
Intercom.helpCenters.ListCollectionsRequest
-
requestOptions:
Collections.RequestOptions
-
-
client.helpCenters.collections.create({ ...params }) -> Intercom.Collection
-
-
-
You can create a new collection by making a POST request to
https://api.intercom.io/help_center/collections.
-
-
-
await client.helpCenters.collections.create({ name: "Thanks for everything", });
-
-
-
request:
Intercom.helpCenters.CreateCollectionRequest
-
requestOptions:
Collections.RequestOptions
-
-
client.helpCenters.collections.find({ ...params }) -> Intercom.Collection
-
-
-
You can fetch the details of a single collection by making a GET request to
https://api.intercom.io/help_center/collections/<id>
.
-
-
-
await client.helpCenters.collections.find({ collection_id: "123", });
-
-
-
request:
Intercom.helpCenters.FindCollectionRequest
-
requestOptions:
Collections.RequestOptions
-
-
client.helpCenters.collections.update({ ...params }) -> Intercom.Collection
-
-
-
You can update the details of a single collection by making a PUT request to
https://api.intercom.io/collections/<id>
.
-
-
-
await client.helpCenters.collections.update({ collection_id: "123", name: "Update collection name", });
-
-
-
request:
Intercom.helpCenters.UpdateCollectionRequest
-
requestOptions:
Collections.RequestOptions
-
-
client.helpCenters.collections.delete({ ...params }) -> Intercom.DeletedCollectionObject
-
-
-
You can delete a single collection by making a DELETE request to
https://api.intercom.io/collections/<id>
.
-
-
-
await client.helpCenters.collections.delete({ collection_id: "123", });
-
-
-
request:
Intercom.helpCenters.DeleteCollectionRequest
-
requestOptions:
Collections.RequestOptions
-
-
client.news.items.list() -> Intercom.PaginatedNewsItemResponse
-
-
-
You can fetch a list of all news items
-
-
-
await client.news.items.list();
-
-
-
requestOptions:
Items.RequestOptions
-
-
client.news.items.create({ ...params }) -> Intercom.NewsItem
-
-
-
You can create a news item
-
-
-
await client.news.items.create({ title: "Halloween is here!", body: "<p>New costumes in store for this spooky season</p>", sender_id: 991267734, state: "live", deliver_silently: true, labels: ["Product", "Update", "New"], reactions: ["\uD83D\uDE06", "\uD83D\uDE05"], newsfeed_assignments: [ { newsfeed_id: 53, published_at: 1664638214, }, ], });
-
-
-
request:
Intercom.NewsItemRequest
-
requestOptions:
Items.RequestOptions
-
-
client.news.items.find({ ...params }) -> Intercom.NewsItem
-
-
-
You can fetch the details of a single news item.
-
-
-
await client.news.items.find({ news_item_id: "123", });
-
-
-
request:
Intercom.news.FindNewsItemRequest
-
requestOptions:
Items.RequestOptions
-
-
client.news.items.update({ ...params }) -> Intercom.NewsItem
-
-
-
await client.news.items.update({ news_item_id: "123", body: { title: "Christmas is here!", body: "<p>New gifts in store for the jolly season</p>", sender_id: 991267745, reactions: ["\uD83D\uDE1D", "\uD83D\uDE02"], }, });
-
-
-
request:
Intercom.news.UpdateNewsItemRequest
-
requestOptions:
Items.RequestOptions
-
-
client.news.items.delete({ ...params }) -> Intercom.DeletedObject
-
-
-
You can delete a single news item.
-
-
-
await client.news.items.delete({ news_item_id: "123", });
-
-
-
request:
Intercom.news.DeleteNewsItemRequest
-
requestOptions:
Items.RequestOptions
-
-
client.news.feeds.listItems({ ...params }) -> Intercom.PaginatedNewsItemResponse
-
-
-
You can fetch a list of all news items that are live on a given newsfeed
-
-
-
await client.news.feeds.listItems({ newsfeed_id: "123", });
-
-
-
request:
Intercom.news.ListNewsFeedItemsRequest
-
requestOptions:
Feeds.RequestOptions
-
-
client.news.feeds.list() -> Intercom.PaginatedNewsfeedResponse
-
-
-
You can fetch a list of all newsfeeds
-
-
-
await client.news.feeds.list();
-
-
-
requestOptions:
Feeds.RequestOptions
-
-
client.news.feeds.find({ ...params }) -> Intercom.Newsfeed
-
-
-
You can fetch the details of a single newsfeed
-
-
-
await client.news.feeds.find({ newsfeed_id: "123", });
-
-
-
request:
Intercom.news.FindNewsFeedRequest
-
requestOptions:
Feeds.RequestOptions
-
-
client.ticketTypes.attributes.create({ ...params }) -> Intercom.TicketTypeAttribute
-
-
-
You can create a new attribute for a ticket type.
-
-
-
await client.ticketTypes.attributes.create({ ticket_type_id: "ticket_type_id", name: "Attribute Title", description: "Attribute Description", data_type: "string", required_to_create: false, });
-
-
-
request:
Intercom.ticketTypes.CreateTicketTypeAttributeRequest
-
requestOptions:
Attributes.RequestOptions
-
-
client.ticketTypes.attributes.update({ ...params }) -> Intercom.TicketTypeAttribute
-
-
-
You can update an existing attribute for a ticket type.
-
-
-
await client.ticketTypes.attributes.update({ ticket_type_id: "ticket_type_id", attribute_id: "attribute_id", description: "New Attribute Description", });
-
-
-
request:
Intercom.ticketTypes.UpdateTicketTypeAttributeRequest
-
requestOptions:
Attributes.RequestOptions
-
-