Contracts
Set contract notes
/a/Contract_setNotes
Replace the notes text for one non-deleted contract.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | ID of a non-deleted contract. Omitted and invalid/nonexistent IDs produce different errors. |
notes | String | Yes | Complete 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
| Response | Condition |
|---|---|
{"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
Contract_getNotesreads the scalar value.Contract_updateDatasupports mapped notes and mention notices.