Hi Freshworks team,
We’re using the following endpoint to implement contact autocomplete:
GET /api/v2/contacts/autocomplete?term=<searchText>
The endpoint works well for finding matching contacts, but it only returns a minimal set of fields.
As far as I can tell, this is also the only Contacts API endpoint that supports searching by a search term (i.e. prefix/partial matching across contact fields). The Search Contacts API doesn’t appear to support this type of lookup, so contacts/autocomplete is the only practical option for implementing a responsive contact picker.
The issue is that sometimes there is a requirement to display only contacts that satisfy certain criteria (in our case, contacts that have an email address). Since the autocomplete response doesn’t provide enough information to determine this, we have to make an additional GET /api/v2/contacts/{id} request for every returned contact before we can populate the autocomplete results. This means that a single autocomplete search may generate dozens of additional API requests, which doesn’t scale well and increases the likelihood of hitting API rate limits.
I understand that the autocomplete endpoint is intentionally lightweight and isn’t expected to return every contact field.
However, it already returns some contact information beyond just the contact ID and name (such as phone number), so it seems reasonable to make other commonly used fields like emailavailable as well, either by default or through an optional parameter if it needs to maintain current behaviour for any reason
For example:
GET /api/v2/contacts/autocomplete?term=<searchText>&fields=id,name,email
or
GET /api/v2/contacts/autocomplete?term=<searchText>&include=email
This would remain fully backward compatible while significantly reducing the number of API requests required for common autocomplete scenarios.
Is there a specific reason the endpoint is intentionally limited to its current response, or could this be considered for a future enhancement?
Thanks so much!