Update the Opportunity Details
Contents
Mobile_API »Update Opportunity
Base URL
https://apimobile.callproof.com
Endpoint
/api/opportunities/{id}
Purpose
Updates an existing opportunity, including stage, owner, value, probability, close date, linked accounts/people, notes, and custom field values. Also records an opportunity history entry for the update.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Unique identifier of the opportunity to update |
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| opportunity_stage_id | integer | Yes | Opportunity stage identifier (must exist) |
| owner_id | integer | Yes | User ID of the opportunity owner (must exist) |
| form_data | string (JSON) | Yes | Custom field values for the opportunity (JSON string) |
| opportunity_name | string | No | Updated opportunity name |
| opportunity_type_id | integer | No | Opportunity type identifier |
| value | number | No | Opportunity value (numeric; values less than 1 are stored as 1) |
| probability | number | No | Win probability from 0 to 100 |
| close_date | string (date) | No | Expected close date |
| notes | string | No | Opportunity notes |
| linked_accounts | string (JSON array) | No | JSON array of contact/account IDs to link (replaces existing linked accounts) |
| linked_contacts | string (JSON array) | No | JSON array of personnel IDs to link (replaces existing linked people) |
Successful Response (200)
Indicates that the opportunity was updated successfully.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "Opportunities Updated Successfully") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 401 with the first validation error message
|
| 500 | Server/update error – opportunity could not be updated |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing/invalid
opportunity_stage_id,owner_id, orform_data; invalidclose_date,value, orprobability. - 500 – Opportunity not found, custom field update failure, or another update error (for example, "Error while Updating Opportunities").
- 401 – Authentication failed or the access token is missing/expired.