When to use this endpoint

Opportunity_setName does not set an opportunity name: opportunities have no mapped name column. Use only when maintaining a legacy caller that intentionally relies on it as a duplicate of Opportunity_setUser.

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. Text becomes zero.

Example request

$result = FM_api('Opportunity_setName', [
	'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 route does not check row/user existence or exclude soft-deleted opportunities. Missing rows return success.

Side effects

  • Sets user_id, updates last_edited, and invalidates the opportunities cache; it creates no audit/notification event.

See it in Fieldmotion

CRM1

No current production CRM1 caller was found; the inline User editor calls Opportunity_setUser.

CRM2

No direct production CRM2 caller was found.

Related endpoints