Update Opportunity
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 replaceWith 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:
| Field | Type | Description |
|---|---|---|
id | string | Required. Id of the opportunity to update. |
name | string | Opportunity name. |
description | string | Description. |
clientId | string | Associated client. |
statusId | string | Pipeline stage id (see List Pipeline Stages). |
value | number | Estimated value. |
estCloseDate, actualCloseDate | date | Estimated / actual close dates. |
sentiment | integer | Sentiment score. |
toDos | ToDoItem[] | Associated to-do items. |
customValues | CustomValue[] | Custom-field values. |
archive | boolean | Whether 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
| Status | Meaning |
|---|---|
412 Precondition Failed | id was missing from the body. |
404 / Not Found | No opportunity with that id exists in your workspace. |