When to use this endpoint

Use File_setNotes for CRM1 inline note editing. CRM2 normally sends notes through File_updateData.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session and establish the tenant database context.

The handler performs no record-owner or resource-specific permission check. CRM screens may hide the action, but callers with tenant API/session access can target any matching file ID.

Parameters

ParameterTypeRequiredDescription
fileIdInteger-compatibleEffectively yesFile ID. The key is not presence-validated; omitted/nonnumeric becomes zero and normally returns file not found.
notesStringYesReplacement notes. Empty string is valid.

Example request

$result = FM_api('File_setNotes', ['fileId' => '4821', 'notes' => 'Check pressure before service.']);

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: notes"}The notes key is absent.
{"error":"file not found"}No live row exists for the ID, including zero or a deleted file.

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

Behaviour and edge cases

  • A live row receives the notes and current server-local last_edited. For User files (type 4), the endpoint also writes a User audit message containing a shortened filename.
  • Other file types receive no audit event or notification.

See it in Fieldmotion

CRM1

Edit Notes on Customer, Job, Asset, User, Task, recurring-Job, or related file tables.

CRM2

Modern file tables use File_updateData; no direct current CRM2 caller was found.

Related endpoints