SOLVED

Rest API | How to update multiple leads with a same Email address.

Go to solution
K_Kamahara
Level 1

Rest API | How to update multiple leads with a same Email address.

I am currently developing the Marketo integration for our service, and there is one requirement that I cannot fulfill. I have a question regarding the Upsert request for Rest API.

In the leads on the instance, there are multiple people with the same email. When I make an Upsert request via the Rest API, specifying that email (as described in the request documentation below), I expect to receive the following response: Lead Upsert Request: Link to the documentation

 

status: skipped

error_code: 1007

message: Multiple lead match lookup criteria

 

This response indicates that multiple leads have been matched, and I am unable to perform the update. I would like to know if there are any API options or other requests that would allow me to update just one of the matched leads. Alternatively, is it possible to update all the matched leads?

I am in a hurry and eagerly await your response.

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Rest API | How to update multiple leads with a same Email address.

Well, this is a documented exception. Updates can only be performed when the key matches a single record. You can use any other lookupField so it's guaranteed to be unique and you'd not run into this error wherein multiple people match the same lookupfield value. Certain system fields and custom fields are available to use as the lookupField with the POST leads endpoint. Also, AFAICT, it's not possible to update more than one matching lead using the same lookup field value.

 

View solution in original post

2 REPLIES 2
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Rest API | How to update multiple leads with a same Email address.

Well, this is a documented exception. Updates can only be performed when the key matches a single record. You can use any other lookupField so it's guaranteed to be unique and you'd not run into this error wherein multiple people match the same lookupfield value. Certain system fields and custom fields are available to use as the lookupField with the POST leads endpoint. Also, AFAICT, it's not possible to update more than one matching lead using the same lookup field value.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Rest API | How to update multiple leads with a same Email address.


Also, AFAICT, it's not possible to update more than one matching lead using the same lookup field value.

That’s right! There’s no way to use a single API call to update multiple leads by passing the Email Address.

 

You have to use Get Multiple Leads by Filter Type, get the matching leads’ IDs, then update by Lead ID.

 

For a single Email Address, this will take least 2 API calls and is therefore quite inefficient, although if you have to do it for multiple addresses at once it’s possible to “multiplex” the calls.