Return Salesforce field mappings in the Lead Field REST API
There's no way to get the mapping between Marketo person fields and Salesforce fields through the API. You can only see it in Admin → Field Management → Field Mapping, by hand. Please add the CRM mapping to the field metadata endpoints so that integrations, audits and AI agents can read it programmatically.
Current behaviour
GET /rest/v1/leads/describe.jsonreturns id, displayName, dataType, length, and the REST and SOAP names.GET /rest/v1/leads/schema/fields.jsonandGET /rest/v1/leads/schema/fields/{fieldApiName}.jsonreturn name, displayName, description, dataType, length, isHidden, isHtmlEncodingInEmail, isSensitive, isCustom and isApiCreated.describe2.jsonreturns acrmManagedflag. In our subscription it'sfalsefor every field, including fields created by the Salesforce sync.- None of these say whether a field syncs with Salesforce, which Salesforce object and field it maps to, or which way it syncs.
- Teams have to guess the mapping from API names (for example, matching on the
__csuffix) or export it manually from the Admin UI. Name matching breaks in these cases:- Standard fields have different names in each system (e.g.
leadSourcevsLeadSource). - One Marketo field can map to both a Lead field and a Contact field.
- A Lead field and a Contact field can be split into two separate Marketo fields.
- Standard fields have different names in each system (e.g.
Requested change
Add an optional crmMapping object to each field returned by the Get Lead Fields endpoints (schema/fields.json and schema/fields/{fieldApiName}.json), and ideally by describe.json too. It should be empty or omitted for fields that aren't synced.
| Attribute | Description | Example |
|---|---|---|
crmType | Connected CRM | "salesforce" |
isSynced | Whether the field currently syncs with the CRM | true |
mappings[] | One entry per CRM object the field maps to | see the next table |
lastUpdatedAt | When the mapping last changed | ISO 8601 timestamp |
Each entry in mappings[]:
| Attribute | Description | Example |
|---|---|---|
crmObject | The Salesforce object | "Lead", "Contact", "Account" |
crmFieldApiName | The Salesforce field API name | "LeadSource", "My_Field__c" |
crmFieldLabel | The Salesforce field label | "Lead Source" |
syncDirection | Which way the field syncs | "bidirectional", "crmToMarketo", "marketoToCrm" |
isStandardMapping | Default mapping or a custom field | true / false |
Example:
{ "name": "leadSource", "displayName": "Lead Source", "dataType": "string", "isCustom": false, "crmMapping": { "crmType": "salesforce", "isSynced": true, "mappings": [ {"crmObject": "Lead", "crmFieldApiName": "LeadSource", "crmFieldLabel": "Lead Source", "syncDirection": "bidirectional", "isStandardMapping": true}, {"crmObject": "Contact", "crmFieldApiName": "LeadSource", "crmFieldLabel": "Lead Source", "syncDirection": "bidirectional", "isStandardMapping": true} ] }}Nice to have:
- A filter on the list endpoint, e.g.
?crmSynced=trueor?crmObject=Contact. - The same
crmMappingon the Company, Opportunity and Sales Person field endpoints. - Support for Microsoft Dynamics as well (
crmType: "dynamics").
