Opportunities
Save legacy opportunity fields
/a/Opportunity_save
Overwrite the six legacy editable columns of an opportunity in one call.
When to use this endpoint
Opportunity_save is a legacy whole-row update route with no current production CRM1/CRM2 caller found. Prefer mapped Opportunity_updateData for new integrations.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.
The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Target ID after integer conversion. |
user | Integer string | Yes | Replacement user_id. |
value | Integer string | Yes | Replacement value; decimals are truncated. |
notes | String | Yes | Replacement notes. This value is interpolated without SQL escaping; quotes can break the query. |
status | Integer string | Yes | Replacement status; no conversion-to-quote behavior is triggered. |
source | Integer string | Yes | Replacement marketing_source. |
Example request
$result = FM_api('Opportunity_save', [
'id' => '481',
'user' => '18',
'value' => '2500',
'notes' => 'Replace reception lighting',
'status' => '1',
'source' => '7',
]);
Example response
{
"ok": "1"
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: id"} | id is omitted. |
{"error":"missing or invalid parameter: user"} | user is omitted. |
{"error":"missing or invalid parameter: value"} | value is omitted. |
{"error":"missing or invalid parameter: notes"} | notes is omitted. |
{"error":"missing or invalid parameter: status"} | status is omitted. |
{"error":"missing or invalid parameter: source"} | source is omitted. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The query does not exclude soft-deleted rows, verify row existence, or validate any related ID. Missing IDs return the same success response.
- It does not change
last_editedorquote_id; setting a conversion-related status does not create a quote.
Side effects
- Updates
user_id,value,notes,status, andmarketing_source, and invalidates the opportunities cache. - Does not write audit history, mention notices, or notification-service events.
See it in Fieldmotion
CRM1
No direct production CRM1 caller was found.
CRM2
No direct production CRM2 caller was found; CRM2 uses the mapped updater.
Related endpoints
Opportunity_updateDatais the current multi-field update route.Opportunity_updateFieldapplies one mapped field across one or more rows.