HighLevel: Update Opportunity
HighLevel opportunities.updateOpportunity: arguments, response, policy and SDK examples.
← Opportunities operations · Get started
Operation gohighlevel.update_opportunity
Provider route: PUT /opportunities/{id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["updateOpportunity"]>[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.updateOpportunity(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.update_opportunity(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.id | string | Required within parent | |
body | Model | Required within parent | Expand Update Opportunity — request body — body |
Referenced models: Update Opportunity — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get Opportunity — response body |
Referenced models: Get Opportunity — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Get Opportunity — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
opportunity | JSON | Optional | The created or retrieved opportunity object |
opportunity (allOf 1) | Model | All variants apply | Expand Search Opportunity — response body — opportunities item |
Referenced models: Search Opportunity — response body — opportunities item
Update Opportunity — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
assignedTo | string | Optional | Identifier of the user the opportunity is assigned to |
customFields | array | Optional | Update custom fields to opportunities. |
customFields[] | JSON | Each item | |
customFields[] (anyOf 1) | Model | Alternative | Expand Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input String Schema V3 |
customFields[] (anyOf 2) | Model | Alternative | Expand Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Array Schema V3 |
customFields[] (anyOf 3) | Model | Alternative | Expand Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Object Schema V3 |
forecastExpectedCloseDate | string | Optional | Expected close date. Supported formats: YYYY/MM/DD, MM/DD/YYYY, YYYY-MM-DD, MM-DD-YYYY, YYYY.MM.DD, MM.DD.YYYY, or ISO 8601 |
forecastProbability | number | Optional | Forecast probability |
monetaryValue | number | Optional | Monetary value of the opportunity |
name | string | Optional | Name of the opportunity |
pipelineId | string | Optional | pipeline Id |
pipelineStageId | string | Optional | Identifier of the pipeline stage |
status | string | Optional | Current status of the opportunity One of: open, won, lost, abandoned, all |
Referenced models: Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Array Schema V3, Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Object Schema V3, Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input String Schema V3
Search Opportunity — response body — opportunities item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
assignedTo | string | Optional | Identifier of the user the opportunity is assigned to |
calendarEvents | array | Optional | Calendar events attached to the opportunity |
calendarEvents[] | array | Each item | |
contact | JSON | Optional | Contact details associated with the opportunity |
contact (allOf 1) | Model | All variants apply | Expand Search Opportunity — response body — opportunities item contact company Name, email, id, name, phone, tags |
contactId | string | Optional | Identifier of the contact linked to the opportunity |
createdAt | string | Optional | ISO 8601 timestamp when the opportunity was created |
customFields | array | Optional | Custom fields associated with the opportunity |
customFields[] | Model | Each item | Expand Search Opportunity — response body — opportunities item custom Fields item |
effectiveProbability | JSON | Optional | |
effectiveProbability (anyOf 1) | number | Alternative | Effective win probability after stage and forecast adjustments (0–100) |
effectiveProbability (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
externalObjectId | string | Optional | External object identifier for integrations |
followers | array | Optional | User IDs following this opportunity |
followers[] | array | Each item | |
forecastDaysSlipped | JSON | Optional | |
forecastDaysSlipped (anyOf 1) | number | Alternative | Total days the close date has slipped |
forecastDaysSlipped (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
forecastExpectedCloseDate | string | Optional | Expected close date for the forecast (YYYY-MM-DD) |
forecastLastSlippedAt | string | Optional | ISO 8601 timestamp of the last close-date slip |
forecastOriginalCloseDate | string | Optional | Original forecast close date before any slippage (YYYY-MM-DD) |
forecastProbability | JSON | Optional | |
forecastProbability (anyOf 1) | number | Alternative | Forecast win probability percentage (0–100) |
forecastProbability (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
forecastSlippageCount | JSON | Optional | |
forecastSlippageCount (anyOf 1) | number | Alternative | Number of times the close date has slipped |
forecastSlippageCount (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
id | string | Optional | Unique identifier of the opportunity |
indexVersion | string | Optional | Index version of the opportunity record |
lastActionDate | string | Optional | ISO 8601 timestamp of the last action on the opportunity |
lastStageChangeAt | string | Optional | ISO 8601 timestamp of the last stage change |
lastStatusChangeAt | string | Optional | ISO 8601 timestamp of the last status change |
locationId | string | Optional | Identifier of the location (sub-account) the opportunity belongs to |
lostReasonId | string | Optional | Identifier of the lost reason if the opportunity was marked lost |
monetaryValue | JSON | Optional | |
monetaryValue (anyOf 1) | number | Alternative | Monetary value of the opportunity |
monetaryValue (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
name | string | Optional | Name of the opportunity |
notes | array | Optional | Notes attached to the opportunity |
notes[] | array | Each item | |
pipelineId | string | Optional | Identifier of the pipeline the opportunity belongs to |
pipelineStageId | string | Optional | Identifier of the pipeline stage the opportunity is in |
source | string | Optional | Source of the opportunity |
status | string | Optional | Current status of the opportunity |
tasks | array | Optional | Tasks attached to the opportunity |
tasks[] | array | Each item | |
updatedAt | string | Optional | ISO 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
Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Array Schema V3
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
fieldValue | array | Optional | Value of the custom field |
fieldValue[] | string | Each item | |
id | string | Required within parent | Pass either `id` or `key` of custom field |
key | string | Optional | Pass either `id` or `key` of custom field |
Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input Object Schema V3
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
fieldValue | object | Optional | Value of the custom field |
id | string | Required within parent | Pass either `id` or `key` of custom field |
key | string | Optional | Pass either `id` or `key` of custom field |
Create Opportunity — request body — body custom Fields item field Value, id, key — custom Fields Input String Schema V3
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
fieldValue | string | Optional | Value of the custom field |
id | string | Optional | Pass either `id` or `key` of custom field |
key | string | Optional | Pass either `id` or `key` of custom field |
Search Opportunity — response body — opportunities item custom Fields item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
fieldValue | JSON | Required within parent | The value of the custom field |
fieldValue (anyOf 1) | string | Alternative | |
fieldValue (anyOf 2) | object | Alternative | |
fieldValue (anyOf 3) | array | Alternative | |
fieldValue (anyOf 3)[] | string | Each item | |
fieldValue (anyOf 4) | array | Alternative | |
fieldValue (anyOf 4)[] | object | Each item | |
id | string | Required within parent | Unique identifier of the custom field |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: gohighlevel.update_opportunity. Catalog operation: update-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.write"]
Pinned headers: {"Version": "v3"}