> ## Documentation Index
> Fetch the complete documentation index at: https://help.hoopai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Conversations

> Returns a list of all conversations matching the search criteria along with the sort and filter options selected.



## OpenAPI

````yaml /api-reference/conversations/openapi.json get /conversations/search
openapi: 3.0.0
info:
  title: Conversations API
  description: Documentation for Conversations API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Conversations
    description: Documentation for Conversations API
  - name: Search
    description: Documentation for Conversations API
  - name: Email
    description: Documentation for Conversations API
  - name: Messages
    description: Documentation for Conversations API
  - name: Providers
    description: Documentation for Conversations API
paths:
  /conversations/search:
    get:
      tags:
        - Search
      summary: Search Conversations
      description: >-
        Returns a list of all conversations matching the search criteria along
        with the sort and filter options selected.
      operationId: search-conversation
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-04-15'
        - name: locationId
          required: true
          in: query
          description: Location Id
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: string
        - name: contactId
          required: false
          in: query
          description: Contact Id
          schema:
            example: 9VEmS0si86GW6gXWU89b
            type: string
        - name: assignedTo
          required: false
          in: query
          description: >-
            User IDs that conversations are assigned to. Multiple IDs can be
            provided as comma-separated values. Use "unassigned" to fetch
            conversations not assigned to any user.
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik
            type: string
        - name: followers
          required: false
          in: query
          description: >-
            User IDs of followers to filter conversations by. Multiple IDs can
            be provided as comma-separated values.
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik
            type: string
        - name: mentions
          required: false
          in: query
          description: User Id of the mention. Multiple values are comma separated.
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik
            type: string
        - name: query
          required: false
          in: query
          description: Search paramater as a string
          schema:
            example: Search string
            type: string
        - name: sort
          required: false
          in: query
          description: Sort paramater - asc or desc
          schema:
            example: asc
            enum:
              - asc
              - desc
            type: string
        - name: startAfterDate
          required: false
          in: query
          description: >-
            Search to begin after the specified date - should contain the sort
            value of the last document
          schema:
            anyOf:
              - $ref: '#/components/schemas/StartAfterNumberSchema'
              - $ref: '#/components/schemas/StartAfterArrayNumberSchema'
        - name: id
          required: false
          in: query
          description: Id of the conversation
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: string
        - name: limit
          required: false
          in: query
          description: Limit of conversations - Default is 20
          schema:
            example: 20
            type: number
        - name: lastMessageType
          required: false
          in: query
          description: Type of the last message in the conversation as a string
          schema:
            example: TYPE_SMS
            enum:
              - TYPE_CALL
              - TYPE_SMS
              - TYPE_EMAIL
              - TYPE_SMS_REVIEW_REQUEST
              - TYPE_WEBCHAT
              - TYPE_SMS_NO_SHOW_REQUEST
              - TYPE_CAMPAIGN_SMS
              - TYPE_CAMPAIGN_CALL
              - TYPE_CAMPAIGN_EMAIL
              - TYPE_CAMPAIGN_VOICEMAIL
              - TYPE_FACEBOOK
              - TYPE_CAMPAIGN_FACEBOOK
              - TYPE_CAMPAIGN_MANUAL_CALL
              - TYPE_CAMPAIGN_MANUAL_SMS
              - TYPE_GMB
              - TYPE_CAMPAIGN_GMB
              - TYPE_REVIEW
              - TYPE_INSTAGRAM
              - TYPE_WHATSAPP
              - TYPE_CUSTOM_SMS
              - TYPE_CUSTOM_EMAIL
              - TYPE_CUSTOM_PROVIDER_SMS
              - TYPE_CUSTOM_PROVIDER_EMAIL
              - TYPE_IVR_CALL
              - TYPE_ACTIVITY_CONTACT
              - TYPE_ACTIVITY_INVOICE
              - TYPE_ACTIVITY_PAYMENT
              - TYPE_ACTIVITY_OPPORTUNITY
              - TYPE_LIVE_CHAT
              - TYPE_LIVE_CHAT_INFO_MESSAGE
              - TYPE_ACTIVITY_APPOINTMENT
              - TYPE_FACEBOOK_COMMENT
              - TYPE_INSTAGRAM_COMMENT
              - TYPE_CUSTOM_CALL
              - TYPE_INTERNAL_COMMENT
              - TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG
            type: string
        - name: lastMessageAction
          required: false
          in: query
          description: Action of the last outbound message in the conversation as string.
          schema:
            example: manual
            enum:
              - automated
              - manual
            type: string
        - name: lastMessageDirection
          required: false
          in: query
          description: Direction of the last message in the conversation as string.
          schema:
            example: inbound
            enum:
              - inbound
              - outbound
            type: string
        - name: status
          required: false
          in: query
          description: >-
            The status of the conversation to be filtered - all, read, unread,
            starred 
          schema:
            example: all
            enum:
              - all
              - read
              - unread
              - starred
              - recents
            type: string
        - name: sortBy
          required: false
          in: query
          description: >-
            The sorting of the conversation to be filtered as - manual messages
            or all messages
          schema:
            example: last_message_date
            enum:
              - last_manual_message_date
              - last_message_date
              - score_profile
            type: string
        - name: sortScoreProfile
          required: false
          in: query
          description: Id of score profile on which sortBy.ScoreProfile should sort on
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: string
        - name: scoreProfile
          required: false
          in: query
          description: >-
            Id of score profile on which conversations should get filtered out,
            works with scoreProfileMin & scoreProfileMax
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: string
        - name: scoreProfileMin
          required: false
          in: query
          description: Minimum value for score
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: number
        - name: scoreProfileMax
          required: false
          in: query
          description: Maximum value for score
          schema:
            example: ABCHkzuJQ8ZMd4Te84GK
            type: number
      responses:
        '200':
          description: Successfully fetched the conversations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendConversationResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
      security:
        - bearer:
            - conversations.readonly
components:
  schemas:
    StartAfterNumberSchema:
      type: object
      properties:
        startAfterDate:
          type: number
          description: >-
            Search to begin after the specified date - should contain the sort
            value of the last document
          example: 1600854
    StartAfterArrayNumberSchema:
      type: object
      properties:
        startAfterDate:
          description: >-
            Search to begin after the specified date - should contain the sort
            value of the last document
          example:
            - 1600854
            - 1600851
          type: array
          items:
            type: string
    SendConversationResponseDto:
      type: object
      properties:
        conversations:
          description: The list of all conversations found for the given query
          type: array
          items:
            $ref: '#/components/schemas/ConversationSchema'
        total:
          type: number
          description: Total Number of results found for the given query
          example: 100
      required:
        - conversations
        - total
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnauthorizedDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: 'Invalid token: access token is invalid'
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
        - error
    ConversationSchema:
      type: object
      properties:
        id:
          type: string
          description: Conversation Id
          example: ABCHkzuJQ8ZMd4Te84GK
        contactId:
          type: string
          description: Contact Id
          example: ABCHkzuJQ8ZMd4Te84GK
        locationId:
          type: string
          description: Location Id
          example: ABCHkzuJQ8ZMd4Te84GK
        lastMessageBody:
          type: string
          description: Content of the most recent message in the conversation
          example: This is a sample message body
        lastMessageType:
          type: string
          description: Channel/type of the most recent message (SMS, Email, Call, etc)
          example: TYPE_SMS
          enum:
            - TYPE_CALL
            - TYPE_SMS
            - TYPE_EMAIL
            - TYPE_SMS_REVIEW_REQUEST
            - TYPE_WEBCHAT
            - TYPE_SMS_NO_SHOW_REQUEST
            - TYPE_CAMPAIGN_SMS
            - TYPE_CAMPAIGN_CALL
            - TYPE_CAMPAIGN_EMAIL
            - TYPE_CAMPAIGN_VOICEMAIL
            - TYPE_FACEBOOK
            - TYPE_CAMPAIGN_FACEBOOK
            - TYPE_CAMPAIGN_MANUAL_CALL
            - TYPE_CAMPAIGN_MANUAL_SMS
            - TYPE_GMB
            - TYPE_CAMPAIGN_GMB
            - TYPE_REVIEW
            - TYPE_INSTAGRAM
            - TYPE_WHATSAPP
            - TYPE_CUSTOM_SMS
            - TYPE_CUSTOM_EMAIL
            - TYPE_CUSTOM_PROVIDER_SMS
            - TYPE_CUSTOM_PROVIDER_EMAIL
            - TYPE_IVR_CALL
            - TYPE_ACTIVITY_CONTACT
            - TYPE_ACTIVITY_INVOICE
            - TYPE_ACTIVITY_PAYMENT
            - TYPE_ACTIVITY_OPPORTUNITY
            - TYPE_LIVE_CHAT
            - TYPE_LIVE_CHAT_INFO_MESSAGE
            - TYPE_ACTIVITY_APPOINTMENT
            - TYPE_FACEBOOK_COMMENT
            - TYPE_INSTAGRAM_COMMENT
            - TYPE_CUSTOM_CALL
            - TYPE_INTERNAL_COMMENT
            - TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG
        type:
          type: string
          description: Primary channel/type of the conversation (Phone, Email, etc)
          example: TYPE_PHONE
          enum:
            - TYPE_PHONE
            - TYPE_EMAIL
            - TYPE_FB_MESSENGER
            - TYPE_REVIEW
            - TYPE_GROUP_SMS
        unreadCount:
          type: number
          description: Number of unread messages in this conversation
          example: 1
        fullName:
          type: string
          description: Complete name of the contact (first and last name)
          example: John Doe
        contactName:
          type: string
          description: >-
            Alternative display name for the contact - used when full name is
            not available
          example: John Doe Company
        email:
          type: string
          description: Primary email address of the contact
          example: johndoe@mailingdomain.com
        phone:
          type: string
          description: Primary phone number of the contact
          example: '+15550001234'
      required:
        - id
        - contactId
        - locationId
        - lastMessageBody
        - lastMessageType
        - type
        - unreadCount
        - fullName
        - contactName
        - email
        - phone
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Use the Access Token generated with user type as Sub-Account (OR)
        Private Integration Token of Sub-Account.
      type: http

````