When to use this endpoint

Use Opportunity_setUser for CRM1’s User column. New code should prefer the mapped updater.

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 stringYesOpportunity ID after integer conversion.
valInteger stringYesReplacement user_id; blank/non-numeric values become zero.

Example request

$result = FM_api('Opportunity_setUser', [
	'id' => '481',
	'val' => '18',
]);

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: val"}val 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 handler does not validate the opportunity/user, active/deleted state, feature, or edit permission. Missing IDs still return success.

Side effects

  • Sets user_id, updates last_edited, and invalidates the opportunities cache.
  • Does not create audit history or notifications.

See it in Fieldmotion

CRM1

Click an Opportunities row’s User cell and leave the select to call this route.

CRM2

CRM2’s inline user picker calls Opportunity_updateData with userID.

Related endpoints