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

> Search Opportunity



## OpenAPI

````yaml /api-reference/opportunities/openapi.json get /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:
    get:
      tags:
        - Search
      summary: Search Opportunity
      description: Search Opportunity
      operationId: search-opportunity
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
        - name: q
          required: false
          in: query
          schema:
            type: string
            example: john@deo.com
        - name: location_id
          required: true
          in: query
          description: Location Id
          schema:
            example: i2SpAtBVHSVea1sL6oah
            type: string
        - name: pipeline_id
          required: false
          in: query
          description: Pipeline Id
          schema:
            example: bCkKGpDsyPP4peuKowkG
            type: string
        - name: pipeline_stage_id
          required: false
          in: query
          description: stage Id
          schema:
            type: string
            example: 7915dedc-8f18-44d5-8bc3-77c04e994a10
        - name: contact_id
          required: false
          in: query
          description: Contact Id
          schema:
            example: WFwVrSSjZ2CNHbZThQX2
            type: string
        - name: status
          required: false
          in: query
          schema:
            type: string
            enum:
              - open
              - won
              - lost
              - abandoned
              - all
        - name: assigned_to
          required: false
          in: query
          schema:
            type: string
            example: 082goXVW3lIExEQPOnd3
        - name: campaignId
          required: false
          in: query
          description: Campaign Id
          schema:
            example: Y2I9XM7aO1hncuSOlc9L
            type: string
        - name: id
          required: false
          in: query
          description: Opportunity Id
          schema:
            example: 123akv4LFn6C9frZoy3e
            type: string
        - name: order
          required: false
          in: query
          schema:
            example: added_asc
            type: string
        - name: endDate
          required: false
          in: query
          description: End date
          schema:
            example: mm-dd-yyyy
            type: string
        - name: startAfter
          required: false
          in: query
          description: Start After
          schema:
            example: '1628008053263'
            type: string
        - name: startAfterId
          required: false
          in: query
          description: Start After Id
          schema:
            example: UIaE1WjAwWKdlyD7osQI
            type: string
        - name: date
          required: false
          in: query
          description: Start date
          schema:
            example: mm-dd-yyyy
            type: string
        - name: country
          required: false
          in: query
          schema:
            example: US
            type: string
        - name: page
          required: false
          in: query
          schema:
            default: 1
            type: number
        - name: limit
          required: false
          in: query
          description: >-
            Limit Per Page records count. will allow maximum up to 100 and
            default will be 20
          schema:
            default: 20
            type: number
        - name: getTasks
          required: false
          in: query
          description: get Tasks in contact
          schema:
            type: boolean
            example: false
        - name: getNotes
          required: false
          in: query
          description: get Notes in contact
          schema:
            type: boolean
            example: false
        - name: getCalendarEvents
          required: false
          in: query
          description: get Calender event in contact
          schema:
            type: boolean
            example: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchSuccessfulResponseDto'
        '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
components:
  schemas:
    SearchSuccessfulResponseDto:
      type: object
      properties:
        opportunities:
          type: array
          items:
            $ref: '#/components/schemas/SearchOpportunitiesResponseSchema'
        meta:
          $ref: '#/components/schemas/SearchMetaResponseSchema'
        aggregations:
          type: object
    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
    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
    SearchMetaResponseSchema:
      type: object
      properties:
        total:
          type: number
          example: 1
        nextPageUrl:
          type: string
          example: >-
            http://localhost:5066/opportunities/search?q=&location_id=ve9EPM428h8vShlRW1KT&pipeline_id=&pipeline_stage_id=&status=&assigned_to+=&campaignId=&id=&order=&endDate=&startAfter=1625203104328&startAfterId=yWQobCRIhRguQtD2llvk&date=&limit=1&country=&page=1
        startAfterId:
          type: string
          example: yWQobCRIhRguQtD2llvk
        startAfter:
          type: number
          example: 1625203104328
        currentPage:
          type: number
          example: 2
        nextPage:
          type: number
          example: 3
        prevPage:
          type: number
          example: 1
    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

````