When to use this endpoint

Use Contract_setNotes from CRM1’s contract-notes popup.

This focused route is simpler than a full contract edit and does not rewrite metadata.

Authentication and permissions

The request must establish an authenticated tenant context. The handler checks DBP but has no additional user, page, or role check.

The row lookup excludes soft-deleted contracts.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesID of a non-deleted contract. Omitted and invalid/nonexistent IDs produce different errors.
notesStringYesComplete replacement text. Blank is accepted and clears notes. No length or note-structure validation is performed.

Example request

$result = FM_api('Contract_setNotes', [
	'id' => '720',
	'notes' => 'Renewal review completed.',
]);

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":"no ID provided"}The id key is omitted.
{"error":"no notes provided"}The notes key is omitted.
{"error":"contract does not exist"}No non-deleted contract has the converted ID.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • There is no no-change shortcut: resubmitting identical notes still touches the row and logs a change.
  • The route does not parse mentions or send notices. It provides no filtering or pagination.

Side effects

  • Updates notes/last_edited, invalidates the contracts cache, and writes a contract audit entry containing the notes value.

See it in Fieldmotion

CRM1

Open the notes icon on Contracts, a customer’s Contracts tab, or an asset’s Contracts tab, save the popup, and filter Network requests for Contract_setNotes.

CRM2

No direct production CRM2 call was found; the contract detail page uses mapped data and its own notes widgets.

Related endpoints