audience-targeting
Installation
SKILL.md
Foundation
Read bulk-operations/SKILL.md first — pagination, JSONL piping, destructive-op safety. Reshape recipes in bulk-operations/resources/json-patterns.md. Resource: resources/contact-segmentation-filters.md is the filter-expression cookbook (lifecycle, lead status, email engagement, activity, deals, owner).
Filter syntax cheat sheet
Source of truth: hubspot objects search --help.
- One
--filterflag = one AND group:--filter "lifecyclestage=lead AND !hubspot_owner_id". - Multiple
--filterflags are OR'd. Use for enum-OR-enum. - Operators:
=,!=,>,>=,<,<=,~(CONTAINS_TOKEN — whole-word, NOT substring),@=(IN),@!=(NOT_IN). - HAS_PROPERTY: bare
nameorname?. NOT_HAS_PROPERTY:!name. Dates:YYYY-MM-DD. - Limits (CRM search API): max 5
--filterflags, max 6 conditions per flag, max 18 conditions total. Prefer@=/@!=for enum lists —lifecyclestage@=lead,customeris one condition,--filter "lifecyclestage=lead" --filter "lifecyclestage=customer"is two groups. - "None of these, or empty" needs two groups —
@!=skips records where the property is unset, so OR in a!namegroup and repeat the shared conditions in both:--filter "hubspot_owner_id=123 AND lifecyclestage@!=customer,evangelist" --filter "hubspot_owner_id=123 AND !lifecyclestage"
~ gotcha: jobtitle~director matches the token "director", not arbitrary substrings. No regex operator — search broadly, post-filter with jq.