Skip to content

HighLevel: Search Opportunities

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

← Opportunities operations · Get started

Operation gohighlevel.search_opportunities_advanced

Provider route: POST /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"]["searchOpportunitiesAdvanced"]>[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.searchOpportunitiesAdvanced(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_opportunities_advanced(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Search Opportunities — request body — body

Referenced models: Search Opportunities — request body — body

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Search Opportunities — response body

Referenced models: Search Opportunities — response body

2 more schemas are linked from the tables above, on the schema pages.

Search Opportunities — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
additionalDetailsJSONRequired within parentFlags to include additional related entities in the response
additionalDetails (allOf 1)ModelAll variants applyExpand Search Opportunities — request body — body additional Details calendar Events, notes, tasks, un Read Conversations
limitnumberRequired within parentMaximum number of results to return per page
locationIdstringRequired within parentLocation Id
pagenumberRequired within parentPage number (0-indexed)
querystringRequired within parentFull-text search query string (max 75 characters)
searchAfterarrayRequired within parentSearch-after cursor values for deep pagination
searchAfter[]stringEach item

Referenced models: Search Opportunities — request body — body additional Details calendar Events, notes, tasks, un Read Conversations

Search Opportunities — response body
FieldTypePresenceDescription and constraints
$objectRoot
aggregationsobjectOptionalAggregation results keyed by aggregation name
opportunitiesarrayOptionalList of opportunities matching the search criteria
opportunities[]ModelEach itemExpand Search Opportunity — response body — opportunities item
stageAggregationsarrayOptionalPer-stage totals when pipeline filter is present
stageAggregations[]ModelEach itemExpand Search Opportunities — response body — stage Aggregations item
totalJSONRequired within parent
total (anyOf 1)numberAlternativeTotal number of opportunities matching the query
total (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Search Opportunity — response body — opportunities item, Search Opportunities — response body — stage Aggregations item

Search Opportunities — request body — body additional Details calendar Events, notes, tasks, un Read Conversations
FieldTypePresenceDescription and constraints
$objectRoot
calendarEventsbooleanRequired within parentInclude calendar events in the response
notesbooleanRequired within parentInclude notes in the response
tasksbooleanRequired within parentInclude tasks in the response
unReadConversationsbooleanRequired within parentInclude unread conversations count in the response
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 Opportunities — response body — stage Aggregations item
FieldTypePresenceDescription and constraints
$objectRoot
openValueJSONRequired within parent
openValue (anyOf 1)numberAlternativeTotal value of open opportunities in this stage
openValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
openWeightedValueJSONRequired within parent
openWeightedValue (anyOf 1)numberAlternativeProbability-weighted value of open opportunities in this stage
openWeightedValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
pipelineStageIdstringRequired within parentIdentifier of the pipeline stage being aggregated
totalCountJSONRequired within parent
totalCount (anyOf 1)numberAlternativeTotal number of opportunities in this stage
totalCount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
totalValueJSONRequired within parent
totalValue (anyOf 1)numberAlternativeTotal monetary value of all opportunities in this stage
totalValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
weightedValueJSONRequired within parent
weightedValue (anyOf 1)numberAlternativeProbability-weighted total value of opportunities in this stage
weightedValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
wonValueJSONRequired within parent
wonValue (anyOf 1)numberAlternativeTotal value of won opportunities in this stage
wonValue (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

SDK function policy ID: gohighlevel.search_opportunities_advanced. Catalog operation: search-opportunities-advanced. 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.