Marketing
Update one lead-source field
/a/MarketingSource_updateField
Set one mapped lead-source field across one or more selected source rows.
When to use this endpoint
Use MarketingSource_updateField for a focused mapped change when the old values in the response are useful.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login but performs no additional Marketing-page, create, edit, delete, or role-permission check.
All reads and writes use the authenticated tenant’s tables. CRM1 and CRM2 hide some controls through client-side permissions; these routes do not repeat those UI checks.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id or ids | Integer-compatible or native array | Yes | One source ID or a native array. id takes precedence. |
field | String | Yes | One exact mapped name from id, name, createDate, and lastEdited. |
val | Field-compatible value | Yes | Replacement value. Name length and timestamp conversion follow the map, but this shared field setter does not enforce the map’s required-name flag. |
Example request
$result = FM_api('MarketingSource_updateField', [
'id' => '30124',
'field' => 'name',
'val' => 'Industry conference',
]);
Example response
{
"ok": 1,
"oldData": [{"id":"30124","name":"Trade show"}]
}
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: field"} | field is absent. |
{"error":"missing or invalid parameter: val"} | val is absent. |
{"error":"missing or invalid field"} | The field is not in the map. |
{"error":"missing or invalid parameter: id/ids"} | Neither ID key is present. |
{"ok":"1","warning":"no change required"} | No selected row exists or every selected row already has the value. |
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 rows receive the current server
last_editedtimestamp unless that field itself is being set. oldDatauses raw database column names and values.- This route can set
nameto an empty string even though mapped create/update operations require a nonblank name. - The route can update creation/edit timestamps as well as the name.
Side effects
- Writes one combined Core history entry for changed IDs and invalidates the marketing-source cache.
See it in Fieldmotion
CRM1
No direct CRM1 caller was found.
CRM2
The shared modal display framework can derive this route for inline field updates, although the full Lead Source page normally uses MarketingSource_updateData.
Related endpoints
MarketingSource_updateDatapatches several fields.MarketingSource_setNameis CRM1’s legacy renamer.