Resources
Prereqs
Read bulk-operations/SKILL.md first — every read/write below uses its JSONL pipe, pagination, and dry-run/digest patterns. Activity-property tables and association rules live in sales-execution/SKILL.md.
Schema is portal-specific. Verify each property before filtering — e.g. hubspot properties get --type contacts notes_last_contacted, ... hs_last_sales_activity_date, ... --type subscriptions hs_subscription_status. If subscriptions returns 403, your token lacks subscriptions-read — use a private-app token with that scope.
1 — Find inactive customers
For more signals (email opt-out, stale tickets, no open deals) see resources/customer-health-signals.md. For >100 hits, use the pagination loop from bulk-operations.
To audit why a customer churned or moved stage — which workflow, integration, import, or UI edit last changed lifecyclestage — use hubspot objects history --type contacts --properties lifecyclestage [--id <recordId>] [--include-ui]. It flattens each property's source history into one row per change.
2 — Flag at-risk subscriptions
subscriptions is a standard object (hubspot objects types confirms). Enum values for hs_subscription_status are portal-specific — verify before filtering, then plug the exact value in:
3 — Create a follow-up task or check-in note
Activity creation lives in sales-execution (full property tables, note + meeting flows). One anchor example — unassociated tasks are invisible in the CRM UI, so always associate:
4 — Bulk task creation for a cohort
Pipe a search through jq into one objects create call, then associate. objects create is Additive — never digest-gated — so --dry-run is a plain preview and you execute by dropping it (no digest/confirm). The digest flow only applies to the irreversible writes in bulk-operations/SKILL.md.
One CLI call for the search, one for the create, and one for all associations — no xargs -I{} per record. The output-order guarantee of objects create (one result per stdin line, in order — see bulk-operations "Output shape") is what makes the paste correct.
Known gaps
- No native churn-score / health-score property — track via a custom property.
hubspot segmentsprovides CRM lists for re-engagement cohorts —segments members-listpulls a list's members, andsegments create/update-filterssave an at-risk audience as a reusable list. Re-engagement enrollment can be built as a workflow viahubspot workflows create/update(seeworkflow-automation/SKILL.md).hubspot sequencesreads Sales Hub sequences (read-only): usesequences enrollments <contact_id>to see whether an at-risk customer was ever engaged through a sales sequence. Sequences are a product API (Sales Hub Professional+,automation.sequences.readscope), not a CRM object type — the CLI cannot create sequences or enroll contacts. This list grows over time; recheckhubspot --help/CHANGELOG.mdrather than assuming an API is absent.hubspot associations createbatches stdin JSONL (up to 100 pairs per API call) — pipe the pairs in one call instead of looping.

