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

ParameterTypeRequiredDescription
idInteger stringYesTarget ID after integer conversion.
userInteger stringYesReplacement user_id.
valueInteger stringYesReplacement value; decimals are truncated.
notesStringYesReplacement notes. This value is interpolated without SQL escaping; quotes can break the query.
statusInteger stringYesReplacement status; no conversion-to-quote behavior is triggered.
sourceInteger stringYesReplacement 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

ResponseCondition
{"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_edited or quote_id; setting a conversion-related status does not create a quote.

Side effects

  • Updates user_id, value, notes, status, and marketing_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