Skip to main content
OpportunitiesVersion: v3

Upsert Opportunity

POST/opportunities/upsert

Create or update an opportunity. If id is sent, that opportunity is updated; an id that does not exist creates a new opportunity instead. Without id, pipelineId is required: when contactId is also sent, the most recent opportunity for that contact in that pipeline is updated; otherwise (no match, or no contactId) a new opportunity is created. A new opportunity without a contact needs name. Always returns 201: new is true when an opportunity was created and false when one was updated.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:opportunities.write
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

API Version. Send v3.

Available optionsv3
Example:v3

Body

idstring

Opportunity id. When sent, that opportunity is updated. An id that does not exist creates a new opportunity instead; an id that belongs to another location returns 404.

Example:yWQobCRIhRguQtD2llvk
pipelineIdstring

Pipeline Id. Required when id is not sent: the upsert then matches within this pipeline (see contactId).

Example:bCkKGpDsyPP4peuKowkG
locationIdstringrequired

locationId

Example:CLu7BaljjqrEjBGKTNNe
followersstring[]

User ids to add to or remove from the followers, depending on followersActionType

Example:["LiKJ2vnRg5ETM8Z19K7"]
isRemoveAllFollowersboolean

Set to true to remove all followers

Example:true
followersActionTypestring

Whether followers are added or removed

Available optionsaddremove
Example:add
contactIdstring

Contact Id, the match key when id is not sent: the newest opportunity for this contact in pipelineId is updated, and a new one is created when there is none. Without id or contactId a new opportunity is always created, and name is required.

Example:mTkSCb1UBjb5tk4OvB69
namestring

Name of the opportunity, up to 150 characters. A longer name returns 422, unless it is the name already stored.

Possible values: <= 150 characters

Example:opportunity name
statusstring

Current status of the opportunity

Available optionsopenwonlostabandoned
Example:open
pipelineStageIdstring

Identifier of the pipeline stage

Example:7915dedc-8f18-44d5-8bc3-77c04e994a10
monetaryValuenumber

Monetary value of the opportunity. A number, or a numeric string such as "1200.50" or "$1,200.50" (characters other than digits and the decimal point are dropped). Must not be negative. null, an empty string, a value with no number in it, or a malformed amount (exponent notation such as "1e3", more than one decimal point, or a comma after the decimal point) is ignored, and an existing opportunity keeps its stored value.

Possible values: >= 0

Example:220
forecastExpectedCloseDatestring

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

Example:2026-04-23
forecastProbabilitynumber

Forecast probability

Example:20
assignedTostring

Identifier of the user the opportunity is assigned to

Example:082goXVW3lIExEQPOnd3
lostReasonIdstring

Lost reason id (24-character hex) from GET /opportunities/lost-reason. Used only when the opportunity's status is, or is set to, lost; any other status clears the stored lost reason, and null clears it too. A malformed id returns 400 LOST_REASON_NOT_FOUND; an id that is unknown, deleted or from another location is saved as null.

Example:65f1c2a4e8b9d3f7a2c4e6b8

Response

Not returned: the API answers 201. Kept so clients generated from earlier docs keep working.

opportunityobjectrequired

The updated or newly created opportunity

newbooleanrequired

Indicates whether the opportunity was newly created (true) or updated (false)

Example:true