audience-targeting

Build a targeted contact segment by filtering on lifecycle, engagement, jobtitle, geography, or firmographics — then export it as JSONL for a campaign or downstream tool.

By hubspot · 1,289 installs

npx skills add hubspot/agent-cli-skills --skill audience-targeting

Source repository · Upstream listing

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 filter flag = one AND group: filter "lifecyclestage=lead AND !hubspot owner id" . Multiple filter flags are OR'd. Use for enum OR enum. Operators: = , != , , = , < , <= , ~ (CONTAINS TOKEN — whole word, NOT substring). HAS PROPERTY: bare name or name? . NOT HAS PROPERTY: !name . Dates: YYYY MM DD . ~ gotcha: jobtitle~director matches the token "director", not arbitrary substrings. No regex operator — search broadly, post filter with jq . Properties this skill turns on Full live list: hubspot properties list type contacts . Enum options aren't exposed by properties get ; discover with hubspot objects list type contacts properties <name limit 100 format json jq r '.data[].properties.<name // empty' sort u . Core fields used here: lifecyclestage , hubspot owner id (bare/ ! for owned/unowned; hubspot owners list for IDs), hs email optout ( !=true excludes opted out), hs email last open date / notes last contacted (recency), jobtitle / country / city (string = or ~ ), num associated deals (0 net new, =1 has pipeline). Firmographics ( industry , numberofemployees , annualrevenue ) live on companies — see cross object section. Common segments More patterns (lead status, deals, owners, combined AND/OR) in resources/contact segmentation filters.md . Cross object: companies in industry → their contacts industry / numberofemployees / annualrevenue live on the company. Build the company set, then traverse — never xargs I{} hubspot objects get per company. associations list emits {"id":"...","type":"company to contact"} , feeding directly into a single batched objects get . Saving and reusing a segment A segment is a JSONL file. Re use for updates, exports, or re fetches: Destructive ops on a saved segment follow the dry run → digest → confirm flow in bulk operations/SKILL.md . Known limits No Lists API surface. Can't save as a HubSpot list or filter by list membership. ~ is token match, not substring. No regex operator. properties get does not return enum options — discover via objects list + jq . associations list has no batch from . Loop to gather IDs, batch the downstream objects get . For 100 results, use the pagination loop in bulk operations/SKILL.md .