When to use this endpoint

Use Opportunity_get when older code needs one simple opportunity object. Use Opportunity_getRequestedDetails for CRM2 mapped fields, metadata, forms, or batching.

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 stringYesPositive opportunity ID.
fieldsNative array or JSON arrayNoMay add only is_starred and/or reason. Unknown names are ignored; malformed JSON adds nothing.

Example request

$opportunity = FM_api('Opportunity_get', [
	'id' => '481',
	'fields' => ['is_starred', 'reason'],
]);

Example response

{
  "id": "481",
  "user_id": "18",
  "customer_id": "1042",
  "value": "2500",
  "notes": "Replace reception lighting",
  "status": "1",
  "marketing_source": "7",
  "quote_id": null,
  "is_starred": "1",
  "reason": "0"
}

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"}The ID is absent or integer-converts below one. This validation runs before the explicit login check.
{"error":"opportunity does not exist"}No non-deleted opportunity has that ID in the authenticated tenant.

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 default fields are id, user_id, customer_id, value, notes, status, marketing_source, and quote_id. They cannot be removed with fields.
  • Database scalar values are normally JSON strings and nullable columns remain null. No related names or parsed notes/form values are added.

See it in Fieldmotion

CRM1

The current Opportunities screen gets rows through Opportunities_getDT; no direct production CRM1 call to this detail route was found.

CRM2

The CRM2 create regression flow and some integrations use it for a simple saved-value check; normal screens use mapped detail/data-table routes.

Related endpoints