HubSpot CRM Database Audit
Run a full diagnostic of a HubSpot portal across eight dimensions, grade each, and produce a prioritized report with a concrete next-skills prescription.
Setup
- Get the API token. Check
.env for HUBSPOT_API_TOKEN; if missing, ask the user for their private app token (pat-na1-...) and store it.
- Install deps with uv:
uv pip install hubspot-api-client python-dotenv.
mkdir -p reports.
Audit dimensions (collect exact counts)
- Database size — total contacts, companies, deals; marketing vs non-marketing contacts.
- Email deliverability — hard bounced (
hs_email_hard_bounce_reason_enum set), soft bounced, global unsubscribes (hs_email_optout), never-emailed (no hs_email_last_send_date), invalid email format, 3+ bounces.
- Data completeness — missing email, company, industry, country/state, lifecyclestage, owner, jobtitle; companies missing domain/industry/geo.
- Engagement health — last-activity distribution (30/90/180/365/365+/never), 90-day open & click rates, zero page views, zero form submissions.
- Duplicate analysis — duplicate emails, companies sharing a
domain, exact-name company dupes (API cannot fuzzy-match; flag for manual review).
- Owner health — deactivated owners still assigned contacts/companies/deals; unowned contacts/companies.
- List & workflow health — active vs static lists, empty lists, active workflows, workflows idle 90+ days, forms with zero submissions.
- Deal pipeline health — deals missing
amount/closedate, deals per stage, stale open deals (60+ days), average age by stage.
API technical notes
- Null checks: use the
NOT_HAS_PROPERTY operator — "never set" is stored as absent, not 0/empty.
- Search API caps at 10,000 results: segment by
createdate ranges or another property and sum.
- Deactivated owners: Owners API needs
archived=True to return them.
- Rate limit: 100 requests / 10 seconds — add delay or exponential backoff on 429.
- Activity dating:
hs_last_sales_activity_timestamp, notes_last_contacted, hs_email_last_open_date, hs_email_last_click_date.
hs_marketable_status is read-only via API.
Script
Write scripts/audit_portal.py that loads the token, inits HubSpot(access_token=...), runs each dimension sequentially (respecting rate limits), collects results into a dict, computes letter grades, renders markdown, and saves to reports/hubspot-audit-{YYYY-MM-DD}.md.
Grading rubric
| Grade |
Criteria (records affected) |
| A |
< 5% |
| B |
5–15% |
| C |
15–30% |
| D |
30–50% |
| F |
> 50% |
For non-percentage dimensions (e.g. Owner Health) use judgment based on affected count and business impact.
Output
Report sections: Executive Summary (grade table + overall grade), Priority Recommendations (ranked by impact with effort + automation feasibility), Detailed Findings (one table per dimension), Next Steps.
Skill prescription (do not just present findings)
For every finding scoring C or worse, map to the next skill and present an ordered, numbered action list grouped Immediate / Next / Later. Mapping:
- Hygiene (first): no-email contacts, hard bounces, global unsubscribes, ghost contacts, duplicate companies, deactivated owners.
- Enrichment (second): company name, industry, geo standardize/backfill, lifecycle stages, unowned contacts.
- Segmentation & scoring (third): ICP tiers, lead scoring, smart lists.
- Automation (fourth): new-contact hygiene, engagement suppression, lifecycle progression, bounce monitoring workflows.
- Maintenance (last): cleanup lists/forms/workflows/dashboards/deals/properties.
If a finding has no matching skill, flag it clearly and offer to create one. End by suggesting hubspot-implementation-plan for the full phased plan.
1---2name: hubspot-audit3description: "Use when running a HubSpot CRM database audit or health check — analyze contacts, companies, deals, deliverability, duplicates, owners, lists/workflows, and deal pipeline across a HubSpot portal, grade each dimension, and produce a prioritized cleanup report. Triggers: HubSpot audit, CRM health check, HubSpot cleanup onboarding, HubSpot private app token, hubspot-api-client."4version: 1.0.05license: MIT6tags: [hubspot, crm, audit, data-quality, deliverability, marketing-ops, sales-ops, saas]7source: https://github.com/TomGranot/hubspot-admin-skills/tree/main/skills/hubspot-audit8derived_from: awesomeclaude9platforms: [hubspot]10prerequisites: [HubSpot private app API token, Python with hubspot-api-client]11metadata:12 source: https://skillmd.com/skills/aashutosh396/hubspot-audit13---1415# HubSpot CRM Database Audit1617Run a full diagnostic of a HubSpot portal across eight dimensions, grade each, and produce a prioritized report with a concrete next-skills prescription.1819## Setup201. Get the API token. Check `.env` for `HUBSPOT_API_TOKEN`; if missing, ask the user for their private app token (`pat-na1-...`) and store it.212. Install deps with uv: `uv pip install hubspot-api-client python-dotenv`.223. `mkdir -p reports`.2324## Audit dimensions (collect exact counts)251. **Database size** — total contacts, companies, deals; marketing vs non-marketing contacts.262. **Email deliverability** — hard bounced (`hs_email_hard_bounce_reason_enum` set), soft bounced, global unsubscribes (`hs_email_optout`), never-emailed (no `hs_email_last_send_date`), invalid email format, 3+ bounces.273. **Data completeness** — missing email, company, industry, country/state, lifecyclestage, owner, jobtitle; companies missing domain/industry/geo.284. **Engagement health** — last-activity distribution (30/90/180/365/365+/never), 90-day open & click rates, zero page views, zero form submissions.295. **Duplicate analysis** — duplicate emails, companies sharing a `domain`, exact-name company dupes (API cannot fuzzy-match; flag for manual review).306. **Owner health** — deactivated owners still assigned contacts/companies/deals; unowned contacts/companies.317. **List & workflow health** — active vs static lists, empty lists, active workflows, workflows idle 90+ days, forms with zero submissions.328. **Deal pipeline health** — deals missing `amount`/`closedate`, deals per stage, stale open deals (60+ days), average age by stage.3334## API technical notes35- **Null checks**: use the `NOT_HAS_PROPERTY` operator — "never set" is stored as absent, not 0/empty.36- **Search API caps at 10,000 results**: segment by `createdate` ranges or another property and sum.37- **Deactivated owners**: Owners API needs `archived=True` to return them.38- **Rate limit**: 100 requests / 10 seconds — add delay or exponential backoff on 429.39- **Activity dating**: `hs_last_sales_activity_timestamp`, `notes_last_contacted`, `hs_email_last_open_date`, `hs_email_last_click_date`.40- **`hs_marketable_status`** is read-only via API.4142## Script43Write `scripts/audit_portal.py` that loads the token, inits `HubSpot(access_token=...)`, runs each dimension sequentially (respecting rate limits), collects results into a dict, computes letter grades, renders markdown, and saves to `reports/hubspot-audit-{YYYY-MM-DD}.md`.4445## Grading rubric46| Grade | Criteria (records affected) |47|---|---|48| A | < 5% |49| B | 5–15% |50| C | 15–30% |51| D | 30–50% |52| F | > 50% |5354For non-percentage dimensions (e.g. Owner Health) use judgment based on affected count and business impact.5556## Output57Report sections: Executive Summary (grade table + overall grade), Priority Recommendations (ranked by impact with effort + automation feasibility), Detailed Findings (one table per dimension), Next Steps.5859## Skill prescription (do not just present findings)60For every finding scoring C or worse, map to the next skill and present an **ordered, numbered action list** grouped Immediate / Next / Later. Mapping:61- **Hygiene (first)**: no-email contacts, hard bounces, global unsubscribes, ghost contacts, duplicate companies, deactivated owners.62- **Enrichment (second)**: company name, industry, geo standardize/backfill, lifecycle stages, unowned contacts.63- **Segmentation & scoring (third)**: ICP tiers, lead scoring, smart lists.64- **Automation (fourth)**: new-contact hygiene, engagement suppression, lifecycle progression, bounce monitoring workflows.65- **Maintenance (last)**: cleanup lists/forms/workflows/dashboards/deals/properties.6667If a finding has no matching skill, flag it clearly and offer to create one. End by suggesting `hubspot-implementation-plan` for the full phased plan.