When to use this endpoint

Use MarketingSource_updateData for CRM2 edits or a multi-field mapped update. Omitted fields remain unchanged.

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

ParameterTypeRequiredDescription
idInteger-compatible or native arrayYesMarketing-source ID. The shared updater also accepts a native array, but individual multi-row failures are discarded, so use a scalar ID for reliable error handling.
nameStringNoLead-source name, maximum 100 characters. It must be nonempty during mapped creation.
createDateUnix timestamp or date stringNoMapped creation time stored as a Unix timestamp. Creation defaults to the current server time; nonnumeric strings are parsed with strtotime().
lastEditedUnix timestamp or date stringNoMapped edit time stored as a Unix timestamp. Creation defaults to now and ordinary updates advance it automatically.

Example request

$result = FM_api('MarketingSource_updateData', [
	'id' => '30124',
	'name' => 'Industry conference',
]);

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: id"}No id key is present.
{"error":"missing or invalid parameter: name"}A supplied name is blank.
{"error":"name is too long."}A supplied name exceeds 100 characters.

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

Behaviour and edge cases

  • Only supplied mapped fields are considered; unknown keys are ignored.
  • A native ID array is accepted, but individual errors are discarded. Use scalar IDs.
  • No duplicate-name check is performed. Successful changes advance lastEdited.

Side effects

  • Changed fields are recorded in Core history and the marketing-source cache is invalidated.

See it in Fieldmotion

CRM1

CRM1 uses MarketingSource_setName for its only editable field.

CRM2

Open Marketing → Marketing Lead Source in CRM2 and filter browser developer tools for the exact function name. Edit a row in the shared table; CRM2 derives MarketingSource_updateData for the save.

Related endpoints