API person search by email not working

There is a problem when searching for person records by email. If the person record has one email then the search works as it is supposed to. But if the record has more than one emails then the search returns empty result.

The api call I’m making is:

Sensitive data is masked with ^^^^^^^

Hi! The search function should work even with multiple e-mails. For example, I was able to receive results for a contact who has two e-mails (see screenshots below).

Could it be an issue with visibility rights (meaning, the user whose API token you’re using doesn’t have rights to see the contact in UI either)?

If you have verified that visibility is not the problem, could you please create a dummy contact and post similar screenshots like mine to show the empty result?

After I saw your screenshot I did more tests. It turns out if I edit the record in pipedrive portal (the website), the search is fixed and I can find the record, but not before that. I compared two records, one not searchable and one that I fixed after editing it in the portal. Structure wise they look identical, but one is searchable and the other is not (not until I manually edit it). The problematic records were imported from csv so something must have went wrong there but still the JSON I get for both records is identical. So now I know how to fix the problem, I need to go through all not searchable records and manually edit them, but why the problem appears in the first place is a mystery. It’s also interesting that the search in pipedrive website works fine and I can find those persons without doing the edit trick, but the API doesn’t find them.
Since the persons have two emails there might have been also a merger at some point of duplicate records and that could have cause the problem (not the import) I don’t know.
All in all pretty strange problem given also that the JSON structure is identical so it’s not obvious what is different with those records that are not searchable.