# Search conversations 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 request to . 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 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 results per page and maximum is . See the pagination section for more details on how to use the 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 as part of 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 accepts a date, the cannot be a string such as ). The 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 body - the query should contain a operator with the value for such conversation to be returned. A query with a operator and a value will not yield a result. | Field | Type | | :---------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- | | id | String | | created_at | Date (UNIX timestamp) | | updated_at | Date (UNIX timestamp) | | source.type | StringAccepted fields are , , , , , , , , and . | | 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 queries Values most be in Array | | NIN | All | Not In Shortcut for 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 | Endpoint: POST /conversations/search Version: 2.13 Security: bearerAuth ## Header parameters: - `Intercom-Version` (string) Intercom API version.By default, it's equal to the version set in the app package. Enum: "1.0", "1.1", "1.2", "1.3", "1.4", "2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9", "2.10", "2.11", "2.12", "2.13", "Unstable" ## Request fields (application/json): - `query` (any, required) - `pagination` (object,null) - `pagination.per_page` (integer) The number of results to fetch per page. Example: 2 - `pagination.starting_after` (string,null) The cursor to use in the next request to get the next page of results. Example: "your-cursor-from-response" ## Response 200 fields (application/json): - `type` (string) Always conversation.list Enum: "conversation.list" - `conversations` (array) The list of conversation objects - `conversations.type` (string) Always conversation. Example: "conversation" - `conversations.id` (string) The id representing the conversation. Example: "1295" - `conversations.title` (string,null) The title given to the conversation. Example: "Conversation Title" - `conversations.created_at` (integer) The time the conversation was created. Example: 1663597223 - `conversations.updated_at` (integer) The last time the conversation was updated. Example: 1663597260 - `conversations.waiting_since` (integer,null) The last time a Contact responded to an Admin. In other words, the time a customer started waiting for a response. Set to null if last reply is from an Admin. Example: 1663597260 - `conversations.snoozed_until` (integer,null) If set this is the time in the future when this conversation will be marked as open. i.e. it will be in a snoozed state until this time. i.e. it will be in a snoozed state until this time. Example: 1663597260 - `conversations.open` (boolean) Indicates whether a conversation is open (true) or closed (false). Example: true - `conversations.state` (string) Can be set to "open", "closed" or "snoozed". Enum: "open", "closed", "snoozed" - `conversations.read` (boolean) Indicates whether a conversation has been read. Example: true - `conversations.priority` (string) If marked as priority, it will return priority or else not_priority. Enum: "priority", "not_priority" - `conversations.admin_assignee_id` (integer,null) The id of the admin assigned to the conversation. If it's not assigned to an admin it will return null. - `conversations.team_assignee_id` (string,null) The id of the team assigned to the conversation. If it's not assigned to a team it will return null. Example: "5017691" - `conversations.tags` (object) A list of tags objects associated with a conversation - `conversations.tags.type` (string) The type of the object Enum: "tag.list" - `conversations.tags.tags` (array) A list of tags objects associated with the conversation. - `conversations.tags.tags.type` (string) value is "tag" Example: "tag" - `conversations.tags.tags.id` (string) The id of the tag Example: "123456" - `conversations.tags.tags.name` (string) The name of the tag Example: "Test tag" - `conversations.tags.tags.applied_at` (integer) The time when the tag was applied to the object Example: 1663597223 - `conversations.tags.tags.applied_by` (object) reference to another object - `conversations.tags.tags.applied_by.type` (string) Example: "contact" - `conversations.tags.tags.applied_by.id` (string,null) Example: "1a2b3c" - `conversations.conversation_rating` (object,null) The Conversation Rating object which contains information on the rating and/or remark added by a Contact and the Admin assigned to the conversation. - `conversations.conversation_rating.rating` (integer) The rating, between 1 and 5, for the conversation. Example: 5 - `conversations.conversation_rating.remark` (string) An optional field to add a remark to correspond to the number rating - `conversations.conversation_rating.created_at` (integer) The time the rating was requested in the conversation being rated. Example: 1671028894 - `conversations.conversation_rating.contact` (object) reference to contact object - `conversations.conversation_rating.contact.type` (string) always contact Enum: "contact" - `conversations.conversation_rating.contact.id` (string) The unique identifier for the contact which is given by Intercom. Example: "5ba682d23d7cf92bef87bfd4" - `conversations.conversation_rating.contact.external_id` (string,null) The unique identifier for the contact which is provided by the Client. Example: "70" - `conversations.conversation_rating.teammate` (object) reference to another object - `conversations.source` (object) The type of the conversation part that started this conversation. Can be Contact, Admin, Campaign, Automated or Operator initiated. - `conversations.source.type` (string) This includes conversation, email, facebook, instagram, phone_call, phone_switch, push, sms, twitter and whatsapp. Enum: "conversation", "email", "facebook", "instagram", "phone_call", "phone_switch", "push", "sms", "twitter", "whatsapp" - `conversations.source.id` (string) The id representing the message. Example: "3" - `conversations.source.delivered_as` (string) The conversation's initiation type. Possible values are customer_initiated, campaigns_initiated (legacy campaigns), operator_initiated (Custom bot), automated (Series and other outbounds with dynamic audience message) and admin_initiated (fixed audience message, ticket initiated by an admin, group email). Example: "operator_initiated" - `conversations.source.subject` (string) Optional. The message subject. For Twitter, this will show a generic message regarding why the subject is obscured. - `conversations.source.body` (string) The message body, which may contain HTML. For Twitter, this will show a generic message regarding why the body is obscured. Example: "

Hey there!

" - `conversations.source.author` (object) The object who initiated the conversation, which can be a Contact, Admin or Team. Bots and campaigns send messages on behalf of Admins or Teams. For Twitter, this will be blank. - `conversations.source.author.type` (string) The type of the author Example: "admin" - `conversations.source.author.id` (string) The id of the author Example: "274" - `conversations.source.author.name` (string) The name of the author Example: "Operator" - `conversations.source.author.email` (string) The email of the author Example: "operator+abcd1234@intercom.io" - `conversations.source.attachments` (array) A list of attachments for the part. - `conversations.source.attachments.type` (string) The type of attachment Example: "upload" - `conversations.source.attachments.name` (string) The name of the attachment Example: "example.png" - `conversations.source.attachments.url` (string) The URL of the attachment Example: "https://picsum.photos/200/300" - `conversations.source.attachments.content_type` (string) The content type of the attachment Example: "image/png" - `conversations.source.attachments.filesize` (integer) The size of the attachment Example: 100 - `conversations.source.attachments.width` (integer) The width of the attachment Example: 100 - `conversations.source.attachments.height` (integer) The height of the attachment Example: 100 - `conversations.source.url` (string,null) The URL where the conversation was started. For Twitter, Email, and Bots, this will be blank. - `conversations.source.redacted` (boolean) Whether or not the source message has been redacted. Only applicable for contact initiated messages. - `conversations.contacts` (object) The list of contacts (users or leads) involved in this conversation. This will only contain one customer unless more were added via the group conversation feature. - `conversations.teammates` (object,null) The list of teammates who participated in the conversation (wrote at least one conversation part). - `conversations.teammates.type` (string) The type of the object - . Example: "admin.list" - `conversations.first_contact_reply` (object,null) An object containing information on the first users message. For a contact initiated message this will represent the users original message. - `conversations.first_contact_reply.created_at` (integer) Example: 1663597223 - `conversations.first_contact_reply.url` (string,null) Example: "https://developers.intercom.com/" - `conversations.sla_applied` (object,null) The SLA Applied object contains the details for which SLA has been applied to this conversation. Important: if there are any canceled sla_events for the conversation - meaning an SLA has been manually removed from a conversation, the sla_status will always be returned as null. - `conversations.sla_applied.type` (string) object type Example: "conversation_sla_summary" - `conversations.sla_applied.sla_name` (string) The name of the SLA as given by the teammate when it was created. - `conversations.sla_applied.sla_status` (string) SLA statuses: - : If there’s at least one hit event in the underlying sla_events table, and no “missed” or “canceled” events for the conversation. - : If there are any missed sla_events for the conversation and no canceled events. If there’s even a single missed sla event, the status will always be missed. A missed status is not applied when the SLA expires, only the next time a teammate replies. - : An SLA has been applied to a conversation, but has not yet been fulfilled. SLA status is active only if there are no “hit, “missed”, or “canceled” events. Enum: "hit", "missed", "cancelled", "active" - `conversations.statistics` (object,null) A Statistics object containing all information required for reporting, with timestamps and calculated metrics. - `conversations.statistics.time_to_assignment` (integer) Duration until last assignment before first admin reply. In seconds. Example: 2310 - `conversations.statistics.time_to_admin_reply` (integer) Duration until first admin reply. Subtracts out of business hours. In seconds. Example: 2310 - `conversations.statistics.time_to_first_close` (integer) Duration until conversation was closed first time. Subtracts out of business hours. In seconds. Example: 2310 - `conversations.statistics.time_to_last_close` (integer) Duration until conversation was closed last time. Subtracts out of business hours. In seconds. Example: 2310 - `conversations.statistics.median_time_to_reply` (integer) Median based on all admin replies after a contact reply. Subtracts out of business hours. In seconds. Example: 2310 - `conversations.statistics.first_contact_reply_at` (integer) Time of first text conversation part from a contact. Example: 1663597233 - `conversations.statistics.first_assignment_at` (integer) Time of first assignment after first_contact_reply_at. Example: 1663597233 - `conversations.statistics.first_admin_reply_at` (integer) Time of first admin reply after first_contact_reply_at. Example: 1663597233 - `conversations.statistics.first_close_at` (integer) Time of first close after first_contact_reply_at. Example: 1663597233 - `conversations.statistics.last_assignment_at` (integer) Time of last assignment after first_contact_reply_at. Example: 1663597233 - `conversations.statistics.last_assignment_admin_reply_at` (integer) Time of first admin reply since most recent assignment. Example: 1663597233 - `conversations.statistics.last_contact_reply_at` (integer) Time of the last conversation part from a contact. Example: 1663597233 - `conversations.statistics.last_admin_reply_at` (integer) Time of the last conversation part from an admin. Example: 1663597233 - `conversations.statistics.last_close_at` (integer) Time of the last conversation close. Example: 1663597233 - `conversations.statistics.last_closed_by_id` (string) The last admin who closed the conversation. Returns a reference to an Admin object. Example: "c3po" - `conversations.statistics.count_reopens` (integer) Number of reopens after first_contact_reply_at. Example: 1 - `conversations.statistics.count_assignments` (integer) Number of assignments after first_contact_reply_at. Example: 1 - `conversations.statistics.count_conversation_parts` (integer) Total number of conversation parts. Example: 1 - `conversations.statistics.assigned_team_first_response_time_by_team` (array) An array of conversation response time objects - `conversations.statistics.assigned_team_first_response_time_by_team.team_id` (integer) Id of the assigned team. Example: 100 - `conversations.statistics.assigned_team_first_response_time_by_team.team_name` (string) Name of the assigned Team, null if team does not exist, Unassigned if no team is assigned. Example: "Team One" - `conversations.statistics.assigned_team_first_response_time_by_team.response_time` (integer) First response time of assigned team in seconds. Example: 2310 - `conversations.statistics.assigned_team_first_response_time_in_office_hours` (array) An array of conversation response time objects within office hours - `conversations.statistics.handling_time` (integer) Time from conversation assignment to conversation close in seconds. Example: 2310 - `conversations.conversation_parts` (object) A list of Conversation Part objects for each part message in the conversation. This is only returned when Retrieving a Conversation, and ignored when Listing all Conversations. There is a limit of 500 parts. - `conversations.conversation_parts.total_count` (integer) Example: 2 - `conversations.linked_objects` (object) An object containing metadata about linked conversations and linked tickets. Up to 1000 can be returned. - `conversations.linked_objects.type` (string) Always list. Enum: "list" - `conversations.linked_objects.total_count` (integer) The total number of linked objects. Example: 100 - `conversations.linked_objects.has_more` (boolean) Whether or not there are more linked objects than returned. - `conversations.linked_objects.data` (array) An array containing the linked conversations and linked tickets. - `conversations.linked_objects.data.type` (string) ticket or conversation Enum: "ticket", "conversation" - `conversations.linked_objects.data.id` (string) The ID of the linked object Example: "7583" - `conversations.linked_objects.data.category` (string,null) Category of the Linked Ticket Object. Enum: "Customer", "Back-office", "Tracker", null - `conversations.ai_agent_participated` (boolean) Indicates whether the AI Agent participated in the conversation. Example: true - `conversations.ai_agent` (object) Data related to AI Agent involvement in the conversation. - `conversations.ai_agent.source_type` (string) The type of the source that triggered AI Agent involvement in the conversation. Enum: "essentials_plan_setup", "profile", "workflow", "workflow_preview", "fin_preview" - `conversations.ai_agent.source_title` (string,null) The title of the source that triggered AI Agent involvement in the conversation. If this is then it will return . Example: "My AI Workflow" - `conversations.ai_agent.last_answer_type` (string,null) The type of the last answer delivered by AI Agent. If no answer was delivered then this will return Enum: null, "ai_answer", "custom_answer" - `conversations.ai_agent.resolution_state` (string,null) The resolution state of AI Agent. If no AI or custom answer has been delivered then this will return . Enum: "assumed_resolution", "confirmed_resolution", "routed_to_team", "abandoned", null - `conversations.ai_agent.rating` (integer,null) The customer satisfaction rating given to AI Agent, from 1-5. Example: 4 - `conversations.ai_agent.rating_remark` (string,null) The customer satisfaction rating remark given to AI Agent. Example: "Very helpful!" - `conversations.ai_agent.content_sources` (object) - `conversations.ai_agent.content_sources.total_count` (integer) The total number of content sources used by AI Agent in the conversation. Example: 1 - `conversations.ai_agent.content_sources.content_sources` (array) The content sources used by AI Agent in the conversation. - `conversations.ai_agent.content_sources.content_sources.content_type` (string) The type of the content source. Enum: "file", "article", "external_content", "content_snippet", "workflow_connector_action" - `conversations.ai_agent.content_sources.content_sources.url` (string) The internal URL linking to the content source for teammates. Example: "/fin-ai-agent/content?content=content_snippet&id=3234924" - `conversations.ai_agent.content_sources.content_sources.title` (string) The title of the content source. Example: "My internal content snippet" - `conversations.ai_agent.content_sources.content_sources.locale` (string) The ISO 639 language code of the content source. Example: "en" - `total_count` (integer) A count of the total number of objects. Example: 12345 - `pages` (object,null) Cursor-based pagination is a technique used in the Intercom API to navigate through large amounts of data. A "cursor" or pointer is used to keep track of the current position in the result set, allowing the API to return the data in small chunks or "pages" as needed. - `pages.type` (string) the type of object . Enum: "pages" - `pages.page` (integer) The current page Example: 1 - `pages.next` (object,null) - `pages.next.per_page` (integer) The number of results to fetch per page. Example: 2 - `pages.next.starting_after` (string,null) The cursor to use in the next request to get the next page of results. Example: "your-cursor-from-response" - `pages.per_page` (integer) Number of results per page Example: 2 - `pages.total_pages` (integer) Total number of pages Example: 13