Update fields on duplicates error when importing contacts

Hello,

I’m using the v3/contacts/import api endpoint to add mainly existing contacts into some lists.

On completion, my import processes often presents the following duplicates error:
(For an import of around 250 contacts in a single list)

Non-imported data

We have not imported 33 duplicate SMS from your import. You can find them in the following files.

After some investigation we figured that some contacts we’re trying to import have a new email address and the import process tries to create a new contact using an existing SMS value.

Is there a way to overwrite either the SMS or Email attribute with their new value to avoid those duplicates errors ?

1 Like

My message has been automatically translated and errors may exist!

I also use this endpoint.

For my part, to update my contacts, I prefer to link them with brevo_id from the outset. As soon as they are created on my site, I export them to brevo and I retrieve their brevo_id.

It is unique even if the contact is found in several lists. Whatever their email or phone number, it can be updated. You can also use an external id that is specific to your database

Good luck :grinning:

1 Like

Hello Phillipe, thank you for the answer !

I’ll try to get it done using the external id approach then, it best suits my need.

Thanks again

I am back after some time as the topic didn’t evolve that much on our side.
I thought the provided solution would work but after some testing the error still occurs. :confused:

In my current scenario I have contacts without EXT_ID attribute I am trying to set them by importing a csv file with EXT_ID,SMS as columns. While importing it tries to create a duplicate entry resulting in an error on SMS attribute.

I then tried to set the EXT_ID manually on a contact and import it with new data like:

EXT_ID EMAIL SMS
know ext_id new email known sms

Even this way it tried to create a new entry with a duplicate error on SMS attribute instead of updating the contact’s email.

I don’t know what I’m missing, any help would be appreciated.

Thanks again.

Good morning,

I took a closer look at the API and unless I’m mistaken

With Import contact, it is possible to update " « updateExistingContacts »: true," but it will be done from the email address

To update, emails must match

So you can’t update a contact with https://api.brevo.com/v3/contacts/import (https://developers.brevo.com/reference/importcontacts-1)from the ext_id or sms

Personally I use https://api.brevo.com/v3/contacts (https://developers.brevo.com/reference/createcontact) with the update activated with « updateEnabled »: true

Values ​​are email or sms or ext_id

I hope this little note was useful to you :slightly_smiling_face:

Have a good day

Philippe

Note: be careful to put all your numbers in integer format and not string. Brevo recognizes that it makes a difference. For this I use the php function FILTER_VALIDATE_INT

2 Likes

Hello,

Thanks again for taking the time, this endpoint should do the trick but the amount of contacts I need to import is too large to use it. I’ll see if I can find a solution one day or another.

Have a good day !