we are facing an issue with the search / filter api (V3) on the contacts object.
In our integration scenario we need to get a contact by its email address. If there is no contact found, we create a new one with this specific email address. This procedure works as long as the email address is not a secondary email address of any contact.
If the email address is a secondary one, the search api can't find the contact. But if we try to create a new contact with this email address it results in an status code 409 (Conflict).
Is there any way to get a contact by its secondary email address?
Thanks for reaching out. Using the EQ operator when searching on the 'email' property won't return contacts based on their secondary emails; it'll only return contacts with a primary email that matches the search term.
What you might consider doing instead (or in combination) is using the CONTAINS_TOKEN operator and searching the 'hs_additional_emails' field. Here's an example body that should do the trick:
Thanks for reaching out. Using the EQ operator when searching on the 'email' property won't return contacts based on their secondary emails; it'll only return contacts with a primary email that matches the search term.
What you might consider doing instead (or in combination) is using the CONTAINS_TOKEN operator and searching the 'hs_additional_emails' field. Here's an example body that should do the trick: