In my old App Script, I use the following syntax:
var contacts = ContactsApp.getContactsByCustomField('tennis', 'Favorite Sport')
See documentation here.
I am now moving to People API. I can't seem to find the documentation for searching people using UserDefined values.
What I have found so far is search by name, not by user defined fields.
This does not search on my user defined fields:
var response = People.People.searchContacts({
query: "tennis",
readMask: "names,userDefined"
})