Skip to content

HighLevel: Search Opportunity

HighLevel opportunities.searchOpportunity: arguments, response, policy and SDK examples.

← Opportunities operations · Get started

Operation gohighlevel.search_opportunity

Provider route: GET /opportunities/search. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/gohighlevel with npm, or alter-sdk-gohighlevel with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { HighLevelIntegration } from "@alter-ai/gohighlevel";
async function execute(input: Parameters<HighLevelIntegration["opportunities"]["searchOpportunity"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new HighLevelIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.opportunities.searchOpportunity(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_gohighlevel import HighLevelIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = HighLevelIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.opportunities.search_opportunity(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectRequired within parentAdditional keys: not allowed
query.qstringOptional
query.statusstringOptionalOne of: open, won, lost, abandoned, all
query.campaignIdstringOptional
query.idstringOptional
query.orderstringOptional
query.endDatestringOptional
query.startAfterstringOptional
query.startAfterIdstringOptional
query.datestringOptional
query.countrystringOptional
query.pagenumberOptionalDefault: 1
query.limitnumberOptionalDefault: 20
query.getTasksbooleanOptional
query.getNotesbooleanOptional
query.getCalendarEventsbooleanOptional
query.locationIdstringRequired within parent
query.pipelineIdstringOptional
query.pipelineStageIdstringOptional
query.contactIdstringOptional
query.assignedTostringOptional

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Search Opportunity — response body

Referenced models: Search Opportunity — response body

Search Opportunity — response body
FieldTypePresenceDescription and constraints
$objectRoot
aggregationsobjectOptionalAggregation results keyed by aggregation name
metaJSONOptionalPagination metadata for the result set
meta (allOf 1)ModelAll variants applyExpand Search Opportunity — response body — meta current Page, next Page, next Page Url, prev Page, start After, start After Id, total
opportunitiesarrayOptionalList of opportunities matching the search criteria
opportunities[]ModelEach itemExpand Search Opportunity — response body — opportunities item

Referenced models: Search Opportunity — response body — meta current Page, next Page, next Page Url, prev Page, start After, start After Id, total, Search Opportunity — response body — opportunities item

Search Opportunity — response body — meta current Page, next Page, next Page Url, prev Page, start After, start After Id, total
FieldTypePresenceDescription and constraints
$objectRoot
currentPageJSONOptional
currentPage (anyOf 1)numberAlternativeCurrent page number
currentPage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
nextPageJSONOptional
nextPage (anyOf 1)numberAlternativeNext page number
nextPage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
nextPageUrlstringOptionalURL to retrieve the next page of results
prevPageJSONOptional
prevPage (anyOf 1)numberAlternativePrevious page number
prevPage (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
startAfterJSONOptional
startAfter (anyOf 1)numberAlternativeCursor timestamp to use for pagination (startAfter param)
startAfter (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
startAfterIdstringOptionalCursor id to use for pagination (startAfterId param)
totalJSONOptional
total (anyOf 1)numberAlternativeTotal number of opportunities matching the query
total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
Search Opportunity — response body — opportunities item
FieldTypePresenceDescription and constraints
$objectRoot
assignedTostringOptionalIdentifier of the user the opportunity is assigned to
calendarEventsarrayOptionalCalendar events attached to the opportunity
calendarEvents[]arrayEach item
contactJSONOptionalContact details associated with the opportunity
contact (allOf 1)ModelAll variants applyExpand Search Opportunity — response body — opportunities item contact company Name, email, id, name, phone, tags
contactIdstringOptionalIdentifier of the contact linked to the opportunity
createdAtstringOptionalISO 8601 timestamp when the opportunity was created
customFieldsarrayOptionalCustom fields associated with the opportunity
customFields[]ModelEach itemExpand Search Opportunity — response body — opportunities item custom Fields item
effectiveProbabilityJSONOptional
effectiveProbability (anyOf 1)numberAlternativeEffective win probability after stage and forecast adjustments (0–100)
effectiveProbability (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
externalObjectIdstringOptionalExternal object identifier for integrations
followersarrayOptionalUser IDs following this opportunity
followers[]arrayEach item
forecastDaysSlippedJSONOptional
forecastDaysSlipped (anyOf 1)numberAlternativeTotal days the close date has slipped
forecastDaysSlipped (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forecastExpectedCloseDatestringOptionalExpected close date for the forecast (YYYY-MM-DD)
forecastLastSlippedAtstringOptionalISO 8601 timestamp of the last close-date slip
forecastOriginalCloseDatestringOptionalOriginal forecast close date before any slippage (YYYY-MM-DD)
forecastProbabilityJSONOptional
forecastProbability (anyOf 1)numberAlternativeForecast win probability percentage (0–100)
forecastProbability (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forecastSlippageCountJSONOptional
forecastSlippageCount (anyOf 1)numberAlternativeNumber of times the close date has slipped
forecastSlippageCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringOptionalUnique identifier of the opportunity
indexVersionstringOptionalIndex version of the opportunity record
lastActionDatestringOptionalISO 8601 timestamp of the last action on the opportunity
lastStageChangeAtstringOptionalISO 8601 timestamp of the last stage change
lastStatusChangeAtstringOptionalISO 8601 timestamp of the last status change
locationIdstringOptionalIdentifier of the location (sub-account) the opportunity belongs to
lostReasonIdstringOptionalIdentifier of the lost reason if the opportunity was marked lost
monetaryValueJSONOptional
monetaryValue (anyOf 1)numberAlternativeMonetary value of the opportunity
monetaryValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringOptionalName of the opportunity
notesarrayOptionalNotes attached to the opportunity
notes[]arrayEach item
pipelineIdstringOptionalIdentifier of the pipeline the opportunity belongs to
pipelineStageIdstringOptionalIdentifier of the pipeline stage the opportunity is in
sourcestringOptionalSource of the opportunity
statusstringOptionalCurrent status of the opportunity
tasksarrayOptionalTasks attached to the opportunity
tasks[]arrayEach item
updatedAtstringOptionalISO 8601 timestamp when the opportunity was last updated

Referenced models: Search Opportunity — response body — opportunities item custom Fields item, Search Opportunity — response body — opportunities item contact company Name, email, id, name, phone, tags

Search Opportunity — response body — opportunities item custom Fields item
FieldTypePresenceDescription and constraints
$objectRoot
fieldValueJSONRequired within parentThe value of the custom field
fieldValue (anyOf 1)stringAlternative
fieldValue (anyOf 2)objectAlternative
fieldValue (anyOf 3)arrayAlternative
fieldValue (anyOf 3)[]stringEach item
fieldValue (anyOf 4)arrayAlternative
fieldValue (anyOf 4)[]objectEach item
idstringRequired within parentUnique identifier of the custom field
Search Opportunity — response body — opportunities item contact company Name, email, id, name, phone, tags
FieldTypePresenceDescription and constraints
$objectRoot
companyNamestringOptionalCompany name associated with the contact
emailstringOptionalEmail address of the contact
idstringOptionalUnique identifier of the contact
namestringOptionalFull name of the contact
phonestringOptionalPhone number of the contact
tagsarrayOptionalTags associated with the contact
tags[]stringEach item

SDK function policy ID: gohighlevel.search_opportunity. Catalog operation: search-opportunity. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["opportunities.readonly"]

Pinned headers: {"Version": "v3"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.