When to use this endpoint

Use MarketingSource_new for compatibility with CRM1’s quick-create flow. Use the mapped create route when the new ID or Core field history is needed.

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
nameStringYesTrimmed nonempty source name, maximum 100 characters.

Example request

$result = FM_api('MarketingSource_new', ['name' => 'Trade show']);

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: name"}The key is absent or trims to an empty string.
{"error":"parameter too long: name. max length 100 characters"}The 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

  • The route does not return the inserted ID. Fetch the list or use MarketingSource_createData when the ID is required immediately.
  • No duplicate-name check is performed.
  • Creation and edit timestamps are both set to the current server Unix time.

Side effects

  • Inserts the tenant source row and invalidates the marketing-source cache. It does not write mapped Core field history.

See it in Fieldmotion

CRM1

Open Settings → Marketing → Source in CRM1 and filter browser developer tools for the exact function name. Choose Create, enter the new lead-source name, and submit the dialog.

CRM2

CRM2’s generic Lead Source page uses MarketingSource_createData, not this legacy route.

Related endpoints