SOLVED

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

Go to solution
jessica_swoogo
Level 1

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

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?

 

jessica_swoogo_0-1711398138549.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

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

SanfordWhiteman_0-1711399755914.png

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.

View solution in original post

SaurabhGoyal_GN
Level 4

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

@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

View solution in original post

Tags (3)
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

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

SanfordWhiteman_0-1711399755914.png

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.

SaurabhGoyal_GN
Level 4

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

@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

Tags (3)
SanfordWhiteman
Level 10 - Community Moderator

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

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