Filter read contacts on custom field

Hello,
I need to query contacts that have a specific custom field filled. How can I do this?

I found this in the documentation ( Accounts Dashboard | HubSpot ) but it’s not clear what each field is for

curl --request POST \
 --url 'https://api.hubapi.com/crm/v3/objects/contacts/batch/read?archived=false' \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "properties": [
 "string"
 ],
 "propertiesWithHistory": [
 "string"
 ],
 "idProperty": "string",
 "inputs": [
 {
 "id": "string"
 }
 ]
}'

Thank you

Hi @KimS,
You can use `/crm/v3/objects/contact/search` endpoint instead (to search contacts by any of their properties). It should be more understandable. Here is a callback example:

curl 'https://api.hubapi.com/crm/v3/objects/contact/search' \
 -H 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 -H 'content-type: application/json' \
 --data '{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "PROPERTY_NAME_TO_FILTER/SEARCH",
 "operator": "EQ",
 "value": "YOUR_VALUE_TO_SEARCH_IN_THE_PROPERTY"
 }
 ]
 }
 ],
 "properties": [
 "property_name1_to_include_in_the_results_for_all_found_contacts",
 "property_name2_to_include_in_the_results_for_all_found_contacts"
 ],
 "limit": 10
}'

Thank you very much, works like a charm.

Actually, what about paging there?
I did a test with limit = 1 (had only 2 items with said field)
And it returns

“paging”:{“next”:{“after”:“1”}}}
what is the next call to make for next page then?