# 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 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 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 | StringAccepted 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 | Endpoint: POST /conversations/search Version: Preview 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", "2.14", "Preview" ## 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.company` (object) Companies allow you to represent organizations using your product. Each company will have its own description and be associated with contacts. You can fetch, create, update and list companies. - `conversations.company.type` (string) Value is company Enum: "company" - `conversations.company.id` (string) The Intercom defined id representing the company. Example: "531ee472cce572a6ec000006" - `conversations.company.name` (string) The name of the company. Example: "Blue Sun" - `conversations.company.app_id` (string) The Intercom defined code of the workspace the company is associated to. Example: "ecahpwf5" - `conversations.company.plan` (object) - `conversations.company.plan.type` (string) Value is always "plan" Example: "plan" - `conversations.company.plan.id` (string) The id of the plan Example: "269315" - `conversations.company.plan.name` (string) The name of the plan Example: "Pro" - `conversations.company.company_id` (string) The company id you have defined for the company. Example: "6" - `conversations.company.remote_created_at` (integer) The time the company was created by you. Example: 1663597223 - `conversations.company.created_at` (integer) The time the company was added in Intercom. Example: 1663597223 - `conversations.company.updated_at` (integer) The last time the company was updated. Example: 1663597223 - `conversations.company.last_request_at` (integer) The time the company last recorded making a request. Example: 1663597223 - `conversations.company.size` (integer) The number of employees in the company. Example: 100 - `conversations.company.website` (string) The URL for the company website. Example: "https://www.intercom.com" - `conversations.company.industry` (string) The industry that the company operates in. Example: "Software" - `conversations.company.monthly_spend` (integer) How much revenue the company generates for your business. Example: 100 - `conversations.company.session_count` (integer) How many sessions the company has recorded. Example: 100 - `conversations.company.user_count` (integer) The number of users in the company. Example: 100 - `conversations.company.custom_attributes` (object) The custom attributes you have set on the company. Example: {"paid_subscriber":true,"monthly_spend":155.5,"team_mates":9} - `conversations.company.tags` (object) The list of tags associated with the company - `conversations.company.tags.type` (string) The type of the object Enum: "tag.list" - `conversations.company.tags.tags` (array) - `conversations.company.tags.tags.type` (string) value is "tag" Example: "tag" - `conversations.company.tags.tags.id` (string) The id of the tag Example: "123456" - `conversations.company.tags.tags.name` (string) The name of the tag Example: "Test tag" - `conversations.company.segments` (object) The list of segments associated with the company - `conversations.company.segments.segments` (array) - `conversations.company.segments.segments.type` (string) The type of object. Enum: "segment" - `conversations.company.segments.segments.id` (string) The unique identifier representing the segment. Example: "56203d253cba154d39010062" - `conversations.company.segments.segments.name` (string) The name of the segment. Example: "Active" - `conversations.company.segments.segments.created_at` (integer) The time the segment was created. Example: 1394621988 - `conversations.company.segments.segments.updated_at` (integer) The time the segment was updated. Example: 1394622004 - `conversations.company.segments.segments.person_type` (string) Type of the contact: contact (lead) or user. Enum: "contact", "user" - `conversations.company.segments.segments.count` (integer,null) The number of items in the user segment. It's returned when include_count=true is included in the request. Example: 3 - `conversations.company.notes` (object) The list of notes associated with the company - `conversations.company.notes.notes` (array) - `conversations.company.notes.notes.type` (string) String representing the object's type. Always has the value note. Example: "note" - `conversations.company.notes.notes.id` (string) The id of the note. Example: "17495962" - `conversations.company.notes.notes.created_at` (integer) The time the note was created. Example: 1674589321 - `conversations.company.notes.notes.company` (object,null) Represents the company that the note was created about. - `conversations.company.notes.notes.company.type` (string) String representing the object's type. Always has the value company. Example: "company" - `conversations.company.notes.notes.company.id` (string) The id of the company. Example: "6329bd9ffe4e2e91dac76188" - `conversations.company.notes.notes.author` (object,null) Admins are teammate accounts that have access to a workspace. - `conversations.company.notes.notes.author.type` (string) String representing the object's type. Always has the value admin. Example: "admin" - `conversations.company.notes.notes.author.id` (string) The id representing the admin. Example: "1295" - `conversations.company.notes.notes.author.name` (string) The name of the admin. Example: "Joe Example" - `conversations.company.notes.notes.author.email` (string) The email of the admin. Example: "jdoe@example.com" - `conversations.company.notes.notes.author.job_title` (string) The job title of the admin. Example: "Associate" - `conversations.company.notes.notes.author.away_mode_enabled` (boolean) Identifies if this admin is currently set in away mode. - `conversations.company.notes.notes.author.away_mode_reassign` (boolean) Identifies if this admin is set to automatically reassign new conversations to the apps default inbox. - `conversations.company.notes.notes.author.away_status_reason_id` (integer,null) The unique identifier of the away status reason Example: 12345 - `conversations.company.notes.notes.author.has_inbox_seat` (boolean) Identifies if this admin has a paid inbox seat to restrict/allow features that require them. Example: true - `conversations.company.notes.notes.author.team_ids` (array) This object represents the avatar associated with the admin. Example: [814865] - `conversations.company.notes.notes.author.avatar` (string,null) Image for the associated team or teammate Example: "https://picsum.photos/200/300" - `conversations.company.notes.notes.author.team_priority_level` (object,null) Admin priority levels for teams - `conversations.company.notes.notes.author.team_priority_level.primary_team_ids` (array,null) The primary team ids for the team Example: [814865] - `conversations.company.notes.notes.author.team_priority_level.secondary_team_ids` (array,null) The secondary team ids for the team Example: [493881] - `conversations.company.notes.notes.author.role` (object,null) The role assigned to this admin. Only present if the admin has a role assigned. - `conversations.company.notes.notes.author.role.type` (string) String representing the object's type. Always has the value role. Example: "role" - `conversations.company.notes.notes.author.role.id` (string) The id of the role. Example: "1" - `conversations.company.notes.notes.author.role.name` (string) The name of the role. Example: "Support Agent" - `conversations.company.notes.notes.body` (string) The body text of the note. Example: "
Text for the note.
" - `conversations.tags` (object) A list of tags objects associated with a conversation - `conversations.tags.tags` (array) A list of tags objects associated with the conversation. - `conversations.tags.tags.applied_at` (integer,null) The time when the tag was applied to the object Example: 1663597223 - `conversations.tags.tags.applied_by` (object,null) The admin who applied the tag - `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.updated_at` (integer) The time the rating was last updated. 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,null) The name of the author Example: "Operator" - `conversations.source.author.email` (string) The email of the author Example: "operator+abcd1234@intercom.io" - `conversations.source.author.from_ai_agent` (boolean) If this conversation part was sent by the AI Agent Example: true - `conversations.source.author.is_ai_answer` (boolean) If this conversation part body was generated by the AI Agent - `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.source.email_message_metadata` (object) Contains metadata if the message was sent as an email - `conversations.source.email_message_metadata.message_id` (string,null) The unique identifier for the email message as specified in the Message-ID header Example: "Previous thread