# Search conversations

`POST /conversations/search`

> This is a subset of the full specification, limited to the `POST /conversations/search` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.18/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.18'
  description: This is a subset of the full specification, limited to the `POST /conversations/search` operation. Components more than 3 `$ref` hops away are not included.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Conversations
    description: Everything about your Conversations
    externalDocs:
      description: What is a conversation?
      url: https://www.intercom.com/help/en/articles/4323904-what-is-a-conversation
paths:
  /conversations/search:
    post:
      summary: Search conversations
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: include_monitors
          in: query
          required: false
          description: If set to true, the response will include a `monitor_evaluations` array on each conversation with the latest QA monitor evaluation for each monitor that has evaluated it.
          example: true
          schema:
            type: boolean
            default: false
        - name: include_scorecards
          in: query
          required: false
          description: If set to true, the response will include a `scorecards` array on each conversation with any QA scorecard results.
          example: true
          schema:
            type: boolean
            default: false
      tags:
        - Conversations
      operationId: searchConversations
      description: |-
        You can search for multiple conversations by the value of their attributes in order to fetch exactly which ones you want.

        To search for conversations, you need to send a `POST` request to `https://api.intercom.io/conversations/search`.

        This will accept a query object in the body which will define your filters in order to search for conversations.

        **Optimizing search queries**

        Search queries can be complex, so optimizing them can help the performance of your search.
        Use the `AND` and `OR` operators to combine multiple filters to get the exact results you need and utilize
        pagination to limit the number of results returned. The default is `20` results per page and maximum is `150`.
        See the [pagination section](https://developers.intercom.com/docs/build-an-integration/learn-more/rest-apis/pagination/#example-search-conversations-request) for more details on how to use the `starting_after` param.

        ### 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 | Integer |
        | type | 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 | Integer |
        | 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 | Integer |
        | team_assignee_id | Integer |
        | 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 | Integer |
        | 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_id | 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 than |
        | >= | Integer  Date (UNIX Timestamp) | Greater than or equal to |
        | < | Integer  Date (UNIX Timestamp) | Lower than |
        | <= | Integer  Date (UNIX Timestamp) | Lower than or equal to |
        | ~ | String | Contains |
        | !~ | String | Doesn't Contain |
        | ^ | String | Starts With |
        | $ | String | Ends With |

        ### Sorting

        Results are sorted by `updated_at`, newest first. To sort differently, add a `sort` object to the request body with a `field` and an `order` of `ascending` or `descending`. `field` is required whenever `sort` is sent, and must be one of the fields in the table above, other than `type`, `state`, `source.subject`, `source.body`, `source.author.id`, `source.author.type`, `source.author.name`, `source.author.email`, `conversation_rating.remark`, `ai_agent.rating_remark` and `ai_agent.source_title`, which can't be sorted. A missing `field`, or one that isn't searchable, returns a `400` error with the code `invalid_field`.
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    type: conversation.list
                    pages:
                      type: pages
                      page: 1
                      per_page: 5
                      total_pages: 1
                    total_count: 1
                    conversations:
                      - type: conversation
                        id: '515'
                        created_at: 1734537546
                        updated_at: 1734537546
                        waiting_since: null
                        snoozed_until: null
                        source:
                          type: conversation
                          id: '403918346'
                          delivered_as: admin_initiated
                          subject: ''
                          body: <p>this is the message body</p>
                          author:
                            type: admin
                            id: '991267691'
                            name: Ciaran210 Lee
                            email: admin210@email.com
                          attachments: []
                          url: null
                          redacted: false
                        contacts:
                          type: contact.list
                          contacts:
                            - type: contact
                              id: 6762f14a1bb69f9f2193bbb3
                              external_id: '70'
                        first_contact_reply: null
                        admin_assignee_id: 991267715
                        team_assignee_id: 5017691
                        open: false
                        state: closed
                        read: false
                        tags:
                          type: tag.list
                          tags: []
                        priority: none
                        sla_applied: null
                        statistics: null
                        conversation_rating: null
                        teammates: null
                        title: null
                        custom_attributes: {}
                        topics: {}
                        ticket: null
                        linked_objects:
                          type: list
                          data: []
                          total_count: 0
                          has_more: false
                        ai_agent: null
                        ai_agent_participated: false
                        sales_agent_participated: false
                        sales_agent: null
                        company: null
                        external_references: []
                        channel:
                          initial: messenger
                          current: messenger
              schema:
                $ref: '#/components/schemas/conversation_list'
        '400':
          description: Invalid request
          content:
            application/json:
              examples:
                Invalid query:
                  value:
                    type: error.list
                    request_id: 5e0a9c24-6f18-4d73-a2b5-8c1e3d7f9a60
                    errors:
                      - code: invalid_query
                        message: Invalid query. Ensure 'field', 'operator', 'value' are present for simple queries. Ensure 'operator' and 'value' for composite queries. Ensure query is a JSON object.
                Invalid operator:
                  value:
                    type: error.list
                    request_id: a1c7e439-0b52-4f86-9d24-3e6a8c0b5d71
                    errors:
                      - code: invalid_operator
                        message: Composite operators must be of type AND or OR
                Invalid field:
                  value:
                    type: error.list
                    request_id: 2f8d6b05-9a31-4c47-b1e8-7d0c5a3e9f36
                    errors:
                      - code: invalid_field
                        message: foo is not a valid search field
                Invalid per_page:
                  value:
                    type: error.list
                    request_id: e9b3a728-4d60-4a15-8f7c-1c5e0d2b6a94
                    errors:
                      - code: invalid_per_page
                        message: per_page must be an integer between 0 and 150
                Invalid starting_after:
                  value:
                    type: error.list
                    request_id: 74a0c5d1-8e39-4b62-a9f4-6b2d1e8c3a07
                    errors:
                      - code: client_error
                        message: Invalid starting_after param. Please try again using a starting_after value from a paginated response
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: d0c4f817-3a96-4e25-8b1d-5f7a2c9e0b38
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/search_request'
            examples:
              successful:
                summary: successful
                value:
                  query:
                    operator: AND
                    value:
                      - field: created_at
                        operator: '>'
                        value: '1306054154'
                  pagination:
                    per_page: 5
components:
  schemas:
    ai_agent:
      title: AI Agent
      type: object
      x-tags:
        - Ai Agent
      description: Data related to AI Agent involvement in the conversation.
      properties:
        source_type:
          type: string
          nullable: true
          description: The type of the source that triggered AI Agent involvement in the conversation.
          enum:
            - essentials_plan_setup
            - profile
            - workflow
            - workflow_preview
            - fin_preview
          example: workflow
        source_title:
          type: string
          description: The title of the source that triggered AI Agent involvement in the conversation. If this is `essentials_plan_setup` then it will return `null`.
          example: My AI Workflow
          nullable: true
        last_answer_type:
          type: string
          description: The type of the last answer delivered by AI Agent. If no answer was delivered then this will return `null`
          enum:
            - null
            - ai_answer
            - custom_answer
          example: ai_answer
          nullable: true
        resolution_state:
          type: string
          description: The resolution state of AI Agent. If no AI or custom answer has been delivered then this will return `null`.
          enum:
            - assumed_resolution
            - confirmed_resolution
            - escalated
            - negative_feedback
            - procedure_handoff
            - null
          example: assumed_resolution
          nullable: true
        rating:
          type: integer
          description: The customer satisfaction rating given to AI Agent, from 1-5.
          example: 4
          nullable: true
        rating_remark:
          type: string
          description: The customer satisfaction rating remark given to AI Agent.
          example: Very helpful!
          nullable: true
        created_at:
          type: integer
          format: date-time
          description: The time when the AI agent rating was created.
          example: 1663597260
          nullable: true
        updated_at:
          type: integer
          format: date-time
          description: The time when the AI agent rating was last updated.
          example: 1663597260
          nullable: true
        content_sources:
          $ref: '#/components/schemas/content_sources_list'
    sales_agent:
      title: Sales Agent
      type: object
      x-tags:
        - Sales Agent
      description: Data related to Sales Agent involvement in the conversation.
      properties:
        outcome:
          type: string
          nullable: true
          description: The fixed outcome of the sales agent interaction, used for billing and tracking.
          enum:
            - qualified
            - disqualified
            - product_discovery
            - escalated_to_support
            - spam
          example: qualified
        routing_outcome:
          type: string
          nullable: true
          description: The identifier of the user-defined routing outcome selected by the sales agent.
          example: enterprise_sales
        collected_data:
          type: object
          nullable: true
          description: A flat key-value map of memory fields collected by the sales agent during the conversation.
          additionalProperties:
            type: string
          example:
            email: user@example.com
            company.name: Acme Inc
    company:
      title: Company
      type: object
      x-tags:
        - Companies
      description: 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.
      properties:
        type:
          type: string
          description: Value is `company`
          enum:
            - company
          example: company
        id:
          type: string
          description: The Intercom defined id representing the company.
          example: 531ee472cce572a6ec000006
        name:
          type: string
          description: The name of the company. Returned HTML-escaped, for example `&` as `&amp;`.
          example: Blue Sun
        app_id:
          type: string
          description: The Intercom defined code of the workspace the company is associated to.
          example: ecahpwf5
        plan:
          type: object
          properties:
            type:
              type: string
              description: Value is always "plan"
              example: plan
            id:
              type: string
              description: The id of the plan
              example: '269315'
            name:
              type: string
              description: The name of the plan
              example: Pro
        company_id:
          type: string
          description: The company id you have defined for the company. Returned HTML-escaped, for example `&` as `&amp;`.
          example: '6'
        remote_created_at:
          type: integer
          description: The time the company was created by you.
          example: 1663597223
        created_at:
          type: integer
          description: The time the company was added in Intercom.
          example: 1663597223
        updated_at:
          type: integer
          description: The last time the company was updated.
          example: 1663597223
        last_request_at:
          type: integer
          description: The time the company last recorded making a request.
          example: 1663597223
        size:
          type: integer
          description: The number of employees in the company.
          example: 100
        website:
          type: string
          description: The URL for the company website.
          example: https://www.intercom.com
        industry:
          type: string
          description: The industry that the company operates in.
          example: Software
        monthly_spend:
          type: integer
          description: How much revenue the company generates for your business.
          example: 100
        session_count:
          type: integer
          description: How many sessions the company has recorded.
          example: 100
        user_count:
          type: integer
          description: The number of users in the company.
          example: 100
        custom_attributes:
          type: object
          description: The custom attributes you have set on the company.
          additionalProperties:
            anyOf:
              - type: string
                nullable: true
              - type: integer
              - type: number
              - type: boolean
          example:
            paid_subscriber: true
            monthly_spend: 155.5
            team_mates: 9
        tags:
          type: object
          description: The list of tags associated with the company
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - tag.list
            tags:
              type: array
              items:
                $ref: '#/components/schemas/tag_basic'
        segments:
          type: object
          description: Always returned empty. Fetch a company's segments with the list attached segments endpoint.
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - segment.list
            segments:
              type: array
              items:
                $ref: '#/components/schemas/segment'
        notes:
          type: object
          description: The list of notes associated with the company
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - note.list
            data:
              type: array
              description: The notes on the company, newest first.
              items:
                $ref: '#/components/schemas/company_note'
            url:
              type: string
              description: The relative URL of the company's notes.
              example: /companies/531ee472cce572a6ec000006/notes
            total_count:
              type: integer
              description: The number of notes in `data`.
              example: 1
            has_more:
              type: boolean
              description: Always `false`. Every note on the company is returned in `data`.
              example: false
    conversation_list_item:
      title: Conversation List Item
      type: object
      x-tags:
        - Conversations
      description: The data returned about your conversations when you list or search them.
      properties:
        type:
          type: string
          description: Always conversation.
          example: conversation
        id:
          type: string
          description: The id representing the conversation.
          example: '1295'
        title:
          type: string
          nullable: true
          description: The title given to the conversation.
          example: Conversation Title
        created_at:
          type: integer
          format: date-time
          description: The time the conversation was created.
          example: 1663597223
        updated_at:
          type: integer
          format: date-time
          description: The last time the conversation was updated.
          example: 1663597260
        waiting_since:
          type: integer
          format: date-time
          nullable: true
          description: 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
        snoozed_until:
          type: integer
          format: date-time
          nullable: true
          description: 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
        open:
          type: boolean
          description: Indicates whether a conversation is open (true) or closed (false).
          example: true
        state:
          type: string
          enum:
            - open
            - closed
            - snoozed
          description: Can be set to "open", "closed" or "snoozed".
          example: open
        read:
          type: boolean
          description: Indicates whether a conversation has been read.
          example: true
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
            - urgent
          description: The priority level of the conversation. Returns one of none, low, medium, high, or urgent.
          example: high
        admin_assignee_id:
          type: integer
          description: The id of the admin assigned to the conversation. If it's not assigned to an admin it will return 0.
          example: 0
        team_assignee_id:
          type: integer
          description: The id of the team assigned to the conversation. If it's not assigned to a team it will return 0.
          example: 5017691
        company:
          $ref: '#/components/schemas/company'
          nullable: true
          description: The company associated with the conversation.
        tags:
          $ref: '#/components/schemas/tags'
        conversation_rating:
          $ref: '#/components/schemas/conversation_rating'
        source:
          $ref: '#/components/schemas/conversation_source'
        contacts:
          $ref: '#/components/schemas/conversation_contacts'
        teammates:
          $ref: '#/components/schemas/conversation_teammates'
        custom_attributes:
          $ref: '#/components/schemas/custom_attributes'
        first_contact_reply:
          $ref: '#/components/schemas/conversation_first_contact_reply'
        sla_applied:
          $ref: '#/components/schemas/sla_applied'
        statistics:
          $ref: '#/components/schemas/conversation_statistics'
        linked_objects:
          $ref: '#/components/schemas/linked_object_list'
        ai_agent_participated:
          type: boolean
          description: Indicates whether the AI Agent participated in the conversation.
          example: true
        ai_agent:
          $ref: '#/components/schemas/ai_agent'
          nullable: true
        sales_agent_participated:
          type: boolean
          description: Indicates whether the Sales Agent participated in the conversation.
          example: false
        sales_agent:
          $ref: '#/components/schemas/sales_agent'
          nullable: true
        channel:
          allOf:
            - $ref: '#/components/schemas/conversation_channel'
          type: object
          nullable: true
          description: The channel through which the conversation was initiated and its current channel.
        topics:
          type: object
          description: The topics of the conversation. An empty object when the workspace doesn't use topics.
          properties:
            type:
              type: string
              description: Always `topic.list`.
              example: topic.list
            topics:
              type: array
              description: The topics of the conversation.
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Always `topic`.
                    example: topic
                  id:
                    type: integer
                    description: The id of the topic.
                    example: 4521
                  name:
                    type: string
                    description: The name of the topic.
                    example: Billing
            total_count:
              type: integer
              description: The number of topics.
              example: 1
        ticket:
          type: object
          nullable: true
          description: The ticket details when the conversation is a ticket. `null` for any other conversation.
          properties:
            type:
              type: string
              description: Always `ticket`.
              example: ticket
            id:
              type: integer
              description: The id of the ticket's conversation.
              example: 1295
            url:
              type: string
              description: The link to the ticket in the inbox.
              example: https://app.intercom.com/a/apps/abcd1234/conversations/1295
            custom_attributes:
              type: object
              description: The ticket's attributes, keyed by attribute name.
              additionalProperties:
                type: object
                properties:
                  value:
                    description: The value of the attribute.
                    anyOf:
                      - type: string
                        nullable: true
                      - type: number
                      - type: boolean
                      - type: array
                        items:
                          type: integer
                      - $ref: '#/components/schemas/file_attribute'
                  type:
                    type: string
                    description: The data type of the attribute.
                    example: string
            state:
              type: string
              description: The current state of the ticket.
              example: submitted
            ticket_type:
              type: string
              description: The name of the ticket type.
              example: Bug report
            ticket_type_description:
              type: string
              description: The description of the ticket type.
              example: Something is broken
            ticket_type_emoji:
              type: string
              nullable: true
              description: The emoji of the ticket type.
              example: 🐛
            ticket_custom_state_admin_label:
              type: string
              nullable: true
              description: The label of the ticket's state as teammates see it.
              example: Submitted
            ticket_custom_state_user_label:
              type: string
              nullable: true
              description: The label of the ticket's state as the customer sees it.
              example: Received
        external_references:
          type: array
          description: References linking this conversation to records in an external helpdesk or CRM system. Populated for Fin Standalone workspaces synced from an external platform; an empty array otherwise. Sorted alphabetically by `type` and capped at 20 entries.
          items:
            $ref: '#/components/schemas/conversation_external_reference'
          example:
            - type: zendesk_ticket
              id: '3633338'
            - type: zendesk_sunshine_conversation
              id: abc-def-uuid
        monitor_evaluations:
          type: array
          description: The latest QA monitor evaluation for each monitor that has evaluated this conversation, whatever its result. Only included when `include_monitors=true` is passed as a query parameter.
          items:
            $ref: '#/components/schemas/conversation_monitor_evaluation'
        scorecards:
          type: array
          description: QA scorecard results for this conversation. Only included when `include_scorecards=true` is passed as a query parameter.
          items:
            $ref: '#/components/schemas/conversation_scorecard'
    conversation_channel:
      title: Conversation Channel
      type: object
      description: The channel through which a conversation was originally initiated and its current channel.
      properties:
        initial:
          type: string
          nullable: true
          description: The channel through which the conversation was originally initiated. Possible values include `messenger`, `zendesk_sunshine`, `zendesk_ticket`, `twitter`, `email`. Returns `null` if channel data is unavailable.
          example: messenger
        current:
          type: string
          nullable: true
          description: The current channel of the conversation. May differ from `initial` if the conversation was migrated between channels. Returns `null` if channel data is unavailable.
          example: messenger
    conversation_external_reference:
      title: Conversation External Reference
      type: object
      description: A reference linking a conversation to a record in an external helpdesk or CRM system, surfaced for Fin Standalone workspaces.
      properties:
        type:
          type: string
          description: The type of external system the reference points to. Possible values include `zendesk_ticket`, `zendesk_sunshine_conversation`, `salesforce_case`, `salesforce_in_app_message_conversation`, `freshdesk_ticket`, `freshchat_conversation`, `hubspot_conversation`, `custom_helpdesk_conversation`, `api_conversation`.
          example: zendesk_ticket
        id:
          type: string
          description: The identifier of the record in the external system. Always serialized as a string, since some external IDs exceed 32-bit integer range.
          example: '3633338'
    conversation_monitor_evaluation:
      title: Conversation Monitor Evaluation
      type: object
      x-tags:
        - Conversations
      description: A QA monitor evaluation of this conversation. Returned in the `monitor_evaluations` array on conversation responses when `include_monitors=true` is passed.
      properties:
        monitor_id:
          type: string
          description: The unique identifier of the monitor that produced this evaluation.
          example: '12345'
        monitor_name:
          type: string
          nullable: true
          description: The name of the monitor at the time of evaluation. Null if the monitor has since been deleted.
          example: Customer complaint handling
        monitor_type:
          type: string
          nullable: true
          description: The type of the monitor. Null if the monitor has since been deleted.
          example: prompt
        result:
          type: string
          description: 'The evaluation outcome reported by the monitor: `included` (the conversation matches the monitor''s criteria), `excluded`, `error` or `awaiting_async_data`.'
          example: included
        explanation:
          type: string
          nullable: true
          description: The reasoning provided by the monitor for its result. May be null if no reasoning was generated.
          example: The customer mentioned wanting a refund without resolution.
        evaluated_at:
          type: integer
          format: date-time
          nullable: true
          description: The time the monitor evaluated this conversation. Null in the rare case the underlying record's timestamp is not yet set.
          example: 1719493065
    conversation_scorecard:
      title: Conversation Scorecard
      type: object
      x-tags:
        - Conversations
      description: A QA scorecard result for this conversation. Returned in the `scorecards` array on conversation responses when `include_scorecards=true` is passed.
      properties:
        scorecard_id:
          type: string
          description: The unique identifier of the scorecard definition.
          example: '67890'
        name:
          type: string
          description: The name of the scorecard.
          example: Standard QA Review
        scorecard_type:
          type: string
          description: The type of scorecard.
          example: human
        passed:
          type: boolean
          nullable: true
          description: Whether the conversation passed the scorecard. Null when the scorecard has not been scored.
          example: true
        score:
          type: number
          nullable: true
          description: The numeric score for the scorecard. Null when the scorecard has not been scored.
          example: 0.85
        ai_score:
          type: number
          nullable: true
          description: The numeric score produced by AI evaluation, if applicable. Null when not AI-scored.
          example: 0.9
        evaluated_at:
          type: integer
          format: date-time
          nullable: true
          description: The time the scorecard was last evaluated. Null in the rare case the underlying record's timestamp is not yet set.
          example: 1719493065
        reviewed_teammate:
          $ref: '#/components/schemas/conversation_scorecard_reviewed_teammate'
        reviewer:
          $ref: '#/components/schemas/conversation_scorecard_reviewer'
        review_status:
          type: string
          nullable: true
          enum:
            - unreviewed
            - submitted
            - passed_review
            - needs_fix
            - wont_fix
            - fix_complete
          description: The status of the review of this scorecard, as shown in the QA reviews list in Intercom. `unreviewed` while the review is waiting for a reviewer's verdict; `submitted` once the review has been submitted; `passed_review`, `needs_fix`, `wont_fix` or `fix_complete` when a teammate set a specific outcome. Null when no review exists for this scorecard.
          example: submitted
        submitted_by:
          $ref: '#/components/schemas/conversation_scorecard_submitted_by'
        revised_by:
          $ref: '#/components/schemas/conversation_scorecard_revised_by'
        notes:
          type: array
          description: The notes teammates left on the QA review linked to this scorecard entry. Empty when the scorecard has no linked review.
          example:
            - id: '9001'
              created_at: 1734537900
              updated_at: 1734537900
              author:
                type: admin
                admin_id: '884120017'
              body: Great empathy in the second reply.
          items:
            $ref: '#/components/schemas/conversation_scorecard_note'
        evaluators:
          type: array
          description: Per-evaluator results within this scorecard.
          items:
            $ref: '#/components/schemas/conversation_scorecard_evaluator'
    conversation_contacts:
      title: Contacts
      type: object
      description: 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.
      properties:
        type:
          type: string
          description: ''
          enum:
            - contact.list
          example: contact.list
        contacts:
          type: array
          description: 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.
          items:
            $ref: '#/components/schemas/contact_reference'
    conversation_first_contact_reply:
      title: First contact reply
      type: object
      nullable: true
      description: An object containing information on the first users message. For a contact initiated message this will represent the users original message.
      properties:
        created_at:
          type: integer
          format: date-time
          description: ''
          example: 1663597223
        type:
          type: string
          description: ''
          example: conversation
        url:
          type: string
          nullable: true
          description: ''
          example: https://developers.intercom.com/
    conversation_list:
      title: Conversation List
      type: object
      description: Conversations are how you can communicate with users in Intercom. They are created when a contact replies to an outbound message, or when one admin directly sends a message to a single contact.
      properties:
        type:
          type: string
          description: Always conversation.list
          enum:
            - conversation.list
          example: conversation.list
        conversations:
          type: array
          description: The list of conversation objects
          items:
            $ref: '#/components/schemas/conversation_list_item'
        total_count:
          type: integer
          description: A count of the total number of objects.
          example: 12345
        pages:
          $ref: '#/components/schemas/cursor_pages'
    conversation_rating:
      title: Conversation Rating
      type: object
      nullable: true
      description: The Conversation Rating object which contains information on the rating and/or remark added by a Contact and the Admin assigned to the conversation.
      properties:
        rating:
          type: integer
          description: The rating, between 1 and 5, for the conversation.
          example: 5
        remark:
          type: string
          description: An optional field to add a remark to correspond to the number rating
          example: ''
        created_at:
          type: integer
          format: date-time
          description: The time the rating was requested in the conversation being rated.
          example: 1671028894
        updated_at:
          type: integer
          format: date-time
          description: The time the rating was last updated.
          example: 1671028894
        contact:
          $ref: '#/components/schemas/contact_reference'
        teammate:
          title: Conversation Rating Teammate
          type: object
          nullable: true
          description: The teammate, bot or workflow the rating is attributed to.
          properties:
            type:
              type: string
              enum:
                - admin
                - team
                - bot
                - workflow
              description: The type of the rated actor. `workflow` when a workflow requested the rating and no teammate took part.
              example: admin
            id:
              type: string
              description: The unique identifier for the rated actor.
              example: '123'
    conversation_source:
      title: Conversation source
      type: object
      description: The type of the conversation part that started this conversation. Can be Contact, Admin, Campaign, Automated or Operator initiated.
      properties:
        type:
          type: string
          description: The origin of this conversation.
          example: email
        id:
          type: string
          nullable: true
          description: The id of the source message.
          example: '3'
        delivered_as:
          type: string
          description: How the conversation was initiated.
          example: operator_initiated
        user_ip:
          type: string
          nullable: true
          description: The IP address of the end user who opened this conversation, when available. Null otherwise, including when the conversation was not opened by an end user.
          example: 203.0.113.42
        recipients:
          type: array
          nullable: true
          description: The recipients of the source message. Only present for email conversations.
          items:
            type: object
            properties:
              type:
                type: string
                description: The recipient type. One of `to`, `cc`, or `bcc`.
                example: to
              email:
                type: string
                format: email
                description: The recipient email address.
                example: user@example.com
              drop_reason:
                type: string
                nullable: true
                description: The reason this recipient was dropped, if applicable.
                example: null
        reply_to:
          type: array
          nullable: true
          description: The Reply-To header addresses of the source message, where a reply will be routed. Can differ from the sender's From address. Only present for email conversations.
          items:
            type: object
            properties:
              email:
                type: string
                format: email
                description: The Reply-To email address.
                example: replies@example.com
              name:
                type: string
                nullable: true
                description: The display name associated with the Reply-To address.
                example: Support Team
        subject:
          type: string
          description: Optional. The message subject. For Twitter, this will show a generic message regarding why the subject is obscured. In webhook payloads for API version 2.15+, this field returns plain text.
          example: ''
        body:
          type: string
          description: The message body, which may contain HTML. For Twitter, this will show a generic message regarding why the body is obscured. In webhook payloads for API version 2.15+, this field returns plain text.
          example: <p>Hey there!</p>
        author:
          $ref: '#/components/schemas/conversation_source_author'
        attachments:
          type: array
          description: A list of attachments for the part.
          items:
            $ref: '#/components/schemas/part_attachment'
        url:
          type: string
          nullable: true
          description: The URL where the conversation was started. For Twitter, Email, and Bots, this will be blank.
          example: null
        redacted:
          type: boolean
          description: Whether or not the source message has been redacted. Only applicable for contact initiated messages.
          example: false
        email_message_metadata:
          $ref: '#/components/schemas/source_email_message_metadata'
    conversation_statistics:
      title: Conversation statistics
      type: object
      nullable: true
      description: A Statistics object containing all information required for reporting, with timestamps and calculated metrics.
      properties:
        type:
          type: string
          description: ''
          example: conversation_statistics
        time_to_assignment:
          type: integer
          description: Duration until last assignment before first admin reply. In seconds.
          example: 2310
        time_to_admin_reply:
          type: integer
          description: Duration until first admin reply. Subtracts out of business hours. In seconds.
          example: 2310
        time_to_first_close:
          type: integer
          description: Duration until conversation was closed first time. Subtracts out of business hours. In seconds.
          example: 2310
        time_to_last_close:
          type: integer
          description: Duration until conversation was closed last time. Subtracts out of business hours. In seconds.
          example: 2310
        median_time_to_reply:
          type: integer
          description: Median based on all admin replies after a contact reply. Subtracts out of business hours. In seconds.
          example: 2310
        first_contact_reply_at:
          type: integer
          format: date-time
          description: Time of first text conversation part from a contact.
          example: 1663597233
        first_assignment_at:
          type: integer
          format: date-time
          description: Time of first assignment after first_contact_reply_at.
          example: 1663597233
        first_admin_reply_at:
          type: integer
          format: date-time
          description: Time of first admin reply after first_contact_reply_at.
          example: 1663597233
        first_close_at:
          type: integer
          format: date-time
          description: Time of first close after first_contact_reply_at.
          example: 1663597233
        last_assignment_at:
          type: integer
          format: date-time
          description: Time of last assignment after first_contact_reply_at.
          example: 1663597233
        last_assignment_admin_reply_at:
          type: integer
          format: date-time
          description: Time of first admin reply since most recent assignment.
          example: 1663597233
        last_contact_reply_at:
          type: integer
          format: date-time
          description: Time of the last conversation part from a contact.
          example: 1663597233
        last_admin_reply_at:
          type: integer
          format: date-time
          description: Time of the last conversation part from an admin.
          example: 1663597233
        last_close_at:
          type: integer
          format: date-time
          description: Time of the last conversation close.
          example: 1663597233
        last_closed_by_id:
          type: string
          description: The last admin who closed the conversation. Returns a reference to an Admin object.
          example: c3po
        count_reopens:
          type: integer
          description: Number of reopens after first_contact_reply_at.
          example: 1
        count_assignments:
          type: integer
          description: Number of assignments after first_contact_reply_at.
          example: 1
        count_conversation_parts:
          type: integer
          description: Total number of conversation parts.
          example: 1
        assigned_team_first_response_time:
          type: array
          description: An array of conversation response time objects
          items:
            $ref: '#/components/schemas/conversation_response_time'
        assigned_team_first_response_time_in_office_hours:
          type: array
          description: An array of conversation response time objects within office hours
          items:
            $ref: '#/components/schemas/conversation_response_time'
        handling_time:
          type: integer
          description: Time from conversation assignment to conversation close in seconds.
          example: 2310
        adjusted_handling_time:
          type: integer
          nullable: true
          description: Adjusted handling time for conversation in seconds. This is the active handling time excluding idle periods when teammates are not actively working on the conversation.
          example: 1800
    conversation_teammates:
      title: Conversation teammates
      type: object
      nullable: true
      description: The list of teammates who participated in the conversation (wrote at least one conversation part).
      properties:
        type:
          type: string
          description: The type of the object - `admin.list`.
          example: admin.list
        admins:
          type: array
          description: The list of teammates who participated in the conversation (wrote at least one conversation part).
          items:
            $ref: '#/components/schemas/reference'
    cursor_pages:
      title: Cursor based pages
      type: object
      description: |
        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.
      nullable: true
      properties:
        type:
          type: string
          description: the type of object `pages`.
          example: pages
          enum:
            - pages
        page:
          type: integer
          description: The current page
          example: 1
        next:
          type: object
          nullable: true
          description: Fetch the next page by sending this `starting_after` cursor. Omitted on the last page.
          properties:
            page:
              type: integer
              description: The number of the next page
              example: 2
            starting_after:
              type: string
              description: The cursor to send in the next request to get the next page of results.
              example: your-cursor-from-response
        per_page:
          type: integer
          description: Number of results per page
          example: 2
        total_pages:
          type: integer
          description: Total number of pages
          example: 13
    custom_attributes:
      title: Custom Attributes
      type: object
      description: An object containing the custom attributes on a conversation as key-value pairs. For relationship attributes the value is a list of custom object instance models. System-defined attributes such as "AI Topic and Subtopic", "CX Score rating", "CX Score explanation" and "CX Score reasons" may also be included.
      properties:
        AI Topic and Subtopic:
          type: array
          readOnly: true
          description: Read-only AI Insights classification of the conversation. Present only with the AI add-on; omitted when the conversation has no classification.
          example:
            - topic_name: Billing
              subtopic_name: Payment Issues
              id: 42
          items:
            $ref: '#/components/schemas/ai_topic_subtopic'
        CX Score reasons:
          type: array
          readOnly: true
          description: Read-only reasons behind the conversation's CX Score. Intercom generates this attribute, so it cannot be set. Omitted when the conversation has no CX Score reasons.
          example:
            - name: Resolution speed
              value: Fast
          items:
            $ref: '#/components/schemas/cx_score_reason'
      additionalProperties:
        anyOf:
          - type: string
          - type: integer
          - type: number
          - type: boolean
          - $ref: '#/components/schemas/datetime'
          - $ref: '#/components/schemas/custom_object_instance_list'
      example:
        paid_subscriber: true
        monthly_spend: 155.5
        team_mates: 9
        start_date_iso8601: '2023-03-04T09:46:14Z'
        end_date_timestamp: 1677923174
        CX Score rating: 4
        CX Score explanation: The conversation was resolved quickly and the customer expressed satisfaction with the outcome.
        AI Topic and Subtopic:
          - topic_name: Billing
            subtopic_name: Payment Issues
            id: 42
        CX Score reasons:
          - name: Resolution speed
            value: Fast
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code.
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              data:
                type: object
                nullable: true
                additionalProperties: true
                description: Optional. Extra detail about the error, for example `required_permissions` on a 403 `action_forbidden` error.
                example:
                  required_permissions:
                    - read_conversations
            required:
              - code
      required:
        - type
        - errors
    file_attribute:
      title: File
      type: object
      description: The value describing a file upload set for a custom attribute
      properties:
        type:
          type: string
          example: upload
        name:
          type: string
          description: The name of the file
          example: Screenshot.png
        url:
          type: string
          description: The url of the file. This is a temporary URL and will expire after 30 minutes.
          example: https://intercom-attachments-1.com/.../Screenshot.png
        content_type:
          type: string
          description: The type of file
          example: image/png
        filesize:
          type: integer
          description: The size of the file in bytes
          example: 11308309
        width:
          type: integer
          description: The width of the file in pixels, if applicable
          example: 3024
        height:
          type: integer
          description: The height of the file in pixels, if applicable
          example: 1964
    intercom_version:
      description: Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.
      type: string
      example: '2.18'
      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'
        - '2.15'
        - '2.16'
        - '2.17'
        - '2.18'
    linked_object_list:
      title: Linked Objects
      type: object
      description: An object containing metadata about linked conversations and linked tickets. Up to 1000 can be returned.
      properties:
        type:
          type: string
          description: Always list.
          enum:
            - list
          example: list
        total_count:
          type: integer
          description: The total number of linked objects.
          example: 100
        has_more:
          type: boolean
          description: Whether or not there are more linked objects than returned.
          example: false
        data:
          type: array
          description: An array containing the linked conversations and linked tickets.
          items:
            $ref: '#/components/schemas/linked_object'
    multiple_filter_search_request:
      title: Multiple Filter Search Request
      description: Search using Intercoms Search APIs with more than one filter.
      type: object
      properties:
        operator:
          type: string
          enum:
            - AND
            - OR
          description: An operator to allow boolean inspection between multiple fields.
          example: AND
        value:
          oneOf:
            - type: array
              description: Add mutiple filters.
              title: multiple filter search request
              items:
                $ref: '#/components/schemas/multiple_filter_search_request'
            - type: array
              description: Add a single filter field.
              title: single filter search request
              items:
                $ref: '#/components/schemas/single_filter_search_request'
    search_request:
      description: Search using Intercoms Search APIs.
      type: object
      title: Search data
      properties:
        query:
          oneOf:
            - $ref: '#/components/schemas/single_filter_search_request'
              title: Single filter search request
            - $ref: '#/components/schemas/multiple_filter_search_request'
              title: multiple filter search request
        pagination:
          $ref: '#/components/schemas/starting_after_paging'
        sort:
          type: object
          description: How to sort the results. Without it, the endpoint's default order is used.
          properties:
            field:
              type: string
              description: The field to sort by, one of the searchable fields listed for the endpoint. Some fields can't be sorted; the endpoint's Sorting section says which. A missing `field`, or one that isn't searchable, returns a `400` error with the code `invalid_field`.
              example: updated_at
            order:
              type: string
              enum:
                - ascending
                - descending
              default: descending
              description: The sort order.
              example: descending
          required:
            - field
      required:
        - query
    single_filter_search_request:
      title: Single Filter Search Request
      description: Search using Intercoms Search APIs with a single filter.
      type: object
      properties:
        field:
          type: string
          description: The accepted field that you want to search on.
          example: created_at
        operator:
          type: string
          enum:
            - '='
            - '!='
            - IN
            - NIN
            - <
            - <=
            - '>'
            - '>='
            - '~'
            - '!~'
            - ^
            - $
          description: |-
            The accepted operators you can use to define how you want to search for the value. Operator support depends on the field's data type. The breakdown below is for Contacts search; the other search endpoints that share this schema accept a different set per field:
            - `string` fields: `=`, `!=`, `IN`, `NIN`, `~`, `!~`, `^`, `$`
            - `tag_id`: `=` and `!=` only. Every other operator returns an error.
            - `boolean` fields: `=`, `!=`, `IN`, `NIN`
            - `integer` fields: `=`, `!=`, `IN`, `NIN`, `<`, `>`, `<=`, `>=`
            - `datetime` fields (standard contact timestamps such as `created_at` and `last_seen_at`): `=`, `!=`, `<`, `>`, `<=`, `>=`. Filtering is on the exact second, in UTC.
            - `date` fields (Date custom attributes): `=`, `<`, `>` only. `!=`, `<=`, and `>=` are not supported and return an error. Values are truncated to a whole UTC day.
          example: '>'
        value:
          oneOf:
            - type: string
            - type: integer
            - type: boolean
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: integer
          description: The value that you want to search on.
          example: '73732934'
          nullable: true
    sla_applied:
      title: Applied SLA
      type: object
      nullable: true
      description: |
        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.
      properties:
        type:
          type: string
          description: object type
          example: conversation_sla_summary
        sla_name:
          type: string
          description: The name of the SLA as given by the teammate when it was created.
          example: ''
        sla_status:
          type: string
          enum:
            - hit
            - missed
            - canceled
            - active
          description: |-
            SLA statuses:
                        - `hit`: If there’s at least one hit event in the underlying sla_events table, and no “missed” or “canceled” events for the conversation.
                        - `missed`: 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.
                        - `active`: 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.
          example: hit
    starting_after_paging:
      title: 'Pagination: Starting After'
      type: object
      nullable: true
      properties:
        per_page:
          type: integer
          description: The number of results to fetch per page.
          example: 2
        starting_after:
          type: string
          description: The cursor to use in the next request to get the next page of results.
          nullable: true
          example: your-cursor-from-response
    tags:
      title: Tags
      type: object
      description: A list of tags objects associated with a conversation, article or internal article
      properties:
        type:
          type: string
          description: The type of the object
          enum:
            - tag.list
          example: tag.list
        tags:
          type: array
          description: A list of tags objects associated with the object.
          items:
            $ref: '#/components/schemas/tag'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
