Using REST API Push Lead to update leads with "updateOnly" created a new lead | Community
Skip to main content
New Participant
March 25, 2024
Solved

Using REST API Push Lead to update leads with "updateOnly" created a new lead

  • March 25, 2024
  • 2 replies
  • 2222 views

We have tested that when using the REST API to update a lead with the conditions:

action: "updateOnly",

lookupField: "id",

 

If the id is not found, a new lead is created with a new id. Why does this happen? If I am specifying updateOnly, shouldn't this prohibit any create actions?

 

 

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 SanfordWhiteman

The property is simply ignored for Push Lead. It would be better if we had JSON schema validation to discard the request immediately, but c’est la vie.

2 replies

SaurabhGoyal_GN
New Participant
March 26, 2024

@jessica_swoogo - As Sandy mentioned, there is no action parameter in "push" lead endpoint. 

If you want to update leads using REST APIs, then you should use  this endpoint - "POST /rest/v1/leads.json" - This enpoint will respect the action parameter and will not create new record in to the system if you are using "updateOnly" as action. 

Here is the marketo doc link.

Thanks,
Saurabh

SanfordWhiteman
New Participant
March 26, 2024

N.B. You’d need to call Push Lead or Sync Program Member after seeing the result of of Sync Lead.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
March 25, 2024

The property is simply ignored for Push Lead. It would be better if we had JSON schema validation to discard the request immediately, but c’est la vie.