Skip to main content

Update Opportunity

PUT PATCH /public/action/opportunities/update

Updates an existing pipeline opportunity, identified by id in the request body. Use PATCH to change a few fields (partial merge) or PUT to replace the whole record.

Authentication: X-API-KEY header (see Authentication).

PUT is a full replace

With PUT, fields you omit are overwritten. For a few fields, use PATCH instead. id is required for both; accountId is forced to your workspace.

Request body

The full Opportunity object. Key fields:

FieldTypeDescription
idstringRequired. Id of the opportunity to update.
namestringOpportunity name.
descriptionstringDescription.
clientIdstringAssociated client.
statusIdstringPipeline stage id (see List Pipeline Stages).
valuenumberEstimated value.
estCloseDate, actualCloseDatedateEstimated / actual close dates.
sentimentintegerSentiment score.
toDosToDoItem[]Associated to-do items.
customValuesCustomValue[]Custom-field values.
archivebooleanWhether the opportunity is archived.

Moving an opportunity between stages is a PATCH on statusId.

Request (PATCH — partial)

curl -X PATCH https://api.withmoxie.com/public/action/opportunities/update \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "66b0f8e5c3a9e40012ab8833",
"statusId": "stage_won",
"value": 14000
}'

Response

Returns the full updated Opportunity object.

{
"id": "66b0f8e5c3a9e40012ab8833",
"accountId": 10016,
"name": "Acme retainer",
"clientId": "66b0f2a1c3a9e40012ab34cd",
"statusId": "stage_won",
"value": 14000,
"estCloseDate": "2026-08-30",
"customValues": []
}

Errors

StatusMeaning
412 Precondition Failedid was missing from the body.
404 / Not FoundNo opportunity with that id exists in your workspace.