Marketing
List lead sources
/a/MarketingSources_list
Return every lead-source ID/name pair for customer, quote, opportunity, report, and marketing-expense selectors.
When to use this endpoint
Use MarketingSources_list to populate a complete lead-source selector or resolve stored IDs for display. The route is intentionally small but unpaged.
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 |
|---|---|---|---|
fields | JSON array or native array | No | The only accepted extra field is name, which is already always selected. Consequently this parameter does not change the current response shape. |
Example request
$sources = FM_api('MarketingSources_list');
Example response
[
{"id":"30124","name":"Trade show"},
{"id":"30125","name":"Referral"}
]
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. |
[] | The tenant has no marketing-source rows. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- There is no filtering, pagination, total count, or order clause. Consumers must not rely on response order.
- The table has no active/deleted state; all stored rows are returned.
- Malformed/unknown
fieldsinput is silently ignored. - Duplicate names can be present and must be distinguished by ID.
See it in Fieldmotion
CRM1
CRM1 loads this route for customer editing, new quotes, quote lists, opportunities, report dashboards, marketing expenses, and export lookup data.
CRM2
CRM2 uses the same list across Customers, Opportunities, Quotes, kanban boards, reports, history display, and the Marketing Expenses page.
Related endpoints
MarketingSources_getByIdfetches selected raw fields for known IDs.MarketingSources_getDataTableprovides search and pagination.