Submitting Lead through API, Can I set the Source or Reason? | Community
Skip to main content
January 23, 2017
Solved

Submitting Lead through API, Can I set the Source or Reason?

  • January 23, 2017
  • 2 replies
  • 4942 views

When we submit an upsert change through the REST API, is it possible to attach a custom Source or Reason with the event?

Normally, after I submit a change, I can see the updated field in that Lead's activity list, it shows the old value, the new value, the time of the change, a Source, and a Reason.

If I log into Marketo and update a Lead by hand, the activity gets a Source of "Person update" and a Reason of "Manual person edit"

If I go through the API, both fields get set to "Web service API"

Could I have my API call save a reason like "My First API Application"

marketohost.wpengine.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/syncLeadUsingPOST

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Grégoire_Miche2

Hi Matthew,

No you cannot. The API does not provide the possibility to set your own values and it's not possible to change it afterwards.

-Greg

2 replies

Grégoire_Miche2
Grégoire_Miche2Accepted solution
New Participant
January 23, 2017

Hi Matthew,

No you cannot. The API does not provide the possibility to set your own values and it's not possible to change it afterwards.

-Greg

ChristinaZuniga
New Participant
January 23, 2017

I have a lot of integrations and they all use "Web service API" which made it difficult for me to determine lead source. What I did was have each of those systems create a hidden field and I connected it to a custom Marketo field I call "Integration Source". Then all they do is pass along the data like "CVENT" or "Vidyard", etc.


That field is overwritten each time a lead interacts with one of those, but I can have interesting moments fire off, lead source created, last lead source updated, etc. that allow me to see when that integration touched or created a lead. It works well for me!

September 20, 2017

Hi Christina,

I'm having the same issue. Could you please explain what you mean when you say those systems create a "hidden field" that you then "connect to" a customer Marketo field?

Do you mean that you have the web service api sources write to your Integration Source field? I created a similar field called API Source that one of our web api sources writes to. I was considering getting the others to do so as well - but realized it would get over-written each time - which isn't helpful when troubleshooting. So I was thinking about blocking API Source from updates and creating an API Source Most Recent field that could get overwritten.

Thank you,

Denise

SanfordWhiteman
New Participant
September 20, 2017

Sounds like a good idea to me, Denise.

Note you can actually attach a Reason to the Push Lead API endpoint. This Reason remains attached to the Push Lead activity and can be queried.

However, not all API-based apps use this endpoint (I would venture that few do b/c they don't see the advantages). Push is a good substitute to for upserting leads in batches, but it doesn't allow for the pure bulk importing of the Bulk Import API.