Files
Update mapped file data
/a/File_updateData
Update several mapped fields on one or more non-deleted files, recording field history and sending file-update/mention notifications.
When to use this endpoint
Use File_updateData for CRM2 file-table edits, especially notes fields that may contain user mentions.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible or native array | Yes | One or more file IDs. Multi-ID mode applies the same values sequentially and returns only {"ok":1}. |
Mapped fields | Mixed | No | Any mapped keys from id, filename, typeId, description, cDate, notes, ownerID, meta, name, typeEnum, lastEdited, url, customerReadable, fileLast_Edited, deleted, ddate, storageType, storageInstance, data, filesize, metaUserID, metaDateExpiry, metaTags, metaIncludeInEmail, metaEditNotesInPortal, metaShareWithSites, metaShowInPortal, metaOutsourcing, and metaLinkForm. Unmapped keys are ignored by the data update but remain available to surrounding notification logic. |
paramTypeEnum | Integer-compatible | No | Removed before update and used only to choose a CRM mention-notice link/message. Supported branches include Customer, Asset, Job, User, recurring Job, Quote, Task, Contract, Stock, and Purchase Order. |
paramPageID | Integer-compatible | No | Parent screen/resource ID embedded in that mention link. |
Example request
$result = FM_api('File_updateData', [
'id' => '4821',
'notes' => 'Please review this file, @Alex',
'paramTypeEnum' => '2',
'paramPageID' => '1042',
]);
Example response
{
"ok": 1,
"oldData": {"notes": "Previous notes"}
}
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":"missing or invalid parameter: id"} | ID key is absent. |
{"warning":"no updated fields.","oldData":[]} | No mapped update field is supplied. |
{"warning":"No data.","oldData":[]} | The ID does not name a non-deleted row. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Changed fields set
last_editedand receive individualfilesaudit history entries. Soft-deleted rows are excluded. No-op values returnNo Change.. sendNotificationruns after a successful helper response. With a supported type/page pair,sendNoticesalso creates mention notices linked to the relevant CRM1 page.- There is no transaction spanning the update and notifications; multi-ID processing does not aggregate per-ID warnings/errors.
See it in Fieldmotion
CRM1
No direct production CRM1 editor was found; CRM1 uses File_setNotes and dedicated switches.
CRM2
Edit Notes or another inline file value on modern Customer, Job, Asset, User, and other file tables.
Related endpoints
File_setFieldis the narrower single-field route.