> ## 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 Opportunities

> Search Opportunities based on combinations of advanced filters. See: https://help.hoopai.com/api-reference/overview/opportunities-search



## OpenAPI

````yaml /api-reference/opportunities/openapi.json post /opportunities/search
openapi: 3.0.0
info:
  title: Opportunities API
  description: Documentation for Opportunities API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Opportunities
    description: Documentation for Opportunities API
  - name: Search
    description: Documentation for Opportunities API
  - name: Pipelines
    description: Documentation for Opportunities API
  - name: Export
    description: Documentation for Opportunities API
  - name: Pipiline Search
    description: Documentation for Opportunities API
  - name: Lost reason
    description: Documentation for Opportunities API
  - name: Followers
    description: Documentation for Opportunities API
paths:
  /opportunities/search:
    post:
      tags:
        - Search
      summary: Search Opportunities
      description: >-
        Search Opportunities based on combinations of advanced filters. See:
        https://help.hoopai.com/api-reference/overview/opportunities-search
      operationId: search-opportunities-advanced
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpportunitySearchBodyDTO'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostSearchSuccessfulResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
      security:
        - bearer:
            - opportunities.readonly
      externalDocs:
        url: https://help.hoopai.com/api-reference/overview/opportunities-search
        description: Click here for more information
components:
  schemas:
    OpportunitySearchBodyDTO:
      type: object
      properties:
        locationId:
          type: string
          description: Location Id
          example: i2SpAtBVHSVea1sL6oah
        query:
          type: string
        limit:
          type: number
        page:
          type: number
        searchAfter:
          type: array
          items:
            type: string
        additionalDetails:
          $ref: '#/components/schemas/AdditionalDetailsDTO'
      required:
        - locationId
        - query
        - limit
        - page
        - searchAfter
        - additionalDetails
    PostSearchSuccessfulResponseDto:
      type: object
      properties:
        opportunities:
          type: array
          items:
            $ref: '#/components/schemas/SearchOpportunitiesResponseSchema'
        total:
          type: number
          example: 100
        aggregations:
          type: object
      required:
        - 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
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error
    AdditionalDetailsDTO:
      type: object
      properties:
        notes:
          type: boolean
        tasks:
          type: boolean
        calendarEvents:
          type: boolean
        unReadConversations:
          type: boolean
      required:
        - notes
        - tasks
        - calendarEvents
        - unReadConversations
    SearchOpportunitiesResponseSchema:
      type: object
      properties:
        id:
          type: string
          example: yWQobCRIhRguQtD2llvk
        name:
          type: string
          example: testing
        monetaryValue:
          type: number
          example: 500
        pipelineId:
          type: string
          example: VDm7RPYC2GLUvdpKmBfC
        pipelineStageId:
          type: string
          example: e93ba61a-53b3-45e7-985a-c7732dbcdb69
        assignedTo:
          type: string
          example: zT46WSCPbudrq4zhWMk6
        status:
          type: string
          example: open
        source:
          type: string
          example: ''
        lastStatusChangeAt:
          type: string
          example: '2021-08-03T04:55:17.355Z'
        lastStageChangeAt:
          type: string
          example: '2021-08-03T04:55:17.355Z'
        lastActionDate:
          type: string
          example: '2021-08-03T04:55:17.355Z'
        indexVersion:
          type: string
          example: 1
        createdAt:
          type: string
          example: '2021-08-03T04:55:17.355Z'
        updatedAt:
          type: string
          example: '2021-08-03T04:55:17.355Z'
        contactId:
          type: string
          example: zT46WSCPbudrq4zhWMk6
        locationId:
          type: string
          example: zT46WSCPbudrq4zhW
        contact:
          $ref: '#/components/schemas/SearchOpportunitiesContactResponseSchema'
        notes:
          type: array
          items:
            type: array
        tasks:
          type: array
          items:
            type: array
        calendarEvents:
          type: array
          items:
            type: array
        lostReasonId:
          type: string
          example: zT46WSCPbudrq4zhWMk6
        customFields:
          type: array
          items:
            $ref: '#/components/schemas/CustomFieldResponseSchema'
        followers:
          type: array
          items:
            type: array
    SearchOpportunitiesContactResponseSchema:
      type: object
      properties:
        id:
          type: string
          example: byMEV0NQinDhq8ZfiOi2
        name:
          type: string
          example: John Deo
        companyName:
          type: string
          example: Tesla Inc
        email:
          type: string
          example: john@deo.com
        phone:
          type: string
          example: +1202-555-0107
        tags:
          type: array
          items:
            type: string
    CustomFieldResponseSchema:
      type: object
      properties:
        id:
          type: string
          example: MgobCB14YMVKuE4Ka8p1
        fieldValue:
          description: The value of the custom field
          oneOf:
            - type: string
            - type: object
            - type: array
              items:
                type: string
            - type: array
              items:
                type: object
      required:
        - id
        - fieldValue
  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

````