feat(hubspot): add notes, emails, properties & associations tools#5037
Conversation
- Add 11 tools: get_properties (read property/enum options), notes (create/get/list/search), email engagements (create/get/list/search), and v4 associations (list/create) - Add scopes: crm.objects.notes.read/write, crm.objects.emails.read/write, sales-email-read (required for email engagement content) - Wire new operations into the HubSpot block (subBlocks, conditions, tool mapping, outputs, BlockMeta templates/skills) - Fix pre-existing bugs found in validation: list_marketing_events list URL (/marketing/marketing-events/v3), appointment property names (hs_appointment_*), get_users output shape (CRM envelope), create_list response unwrap, and stringified-associations parsing in create tools - Regenerate integration docs
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview OAuth now requests Correctness fixes bundled with the expansion: marketing-events list URL, appointment fields switched from Reviewed by Cursor Bugbot for commit 73b42db. Configure here. |
Greptile SummaryThis PR adds 11 new HubSpot tools (notes, email engagements, property definitions, and v4 associations) along with the
Confidence Score: 5/5The change is safe to merge — all new tools follow established patterns, the dual-dispatch routing in the block is correct, and the OAuth scope addition is the only change that touches existing user sessions (re-auth required for email content, as documented). All 11 new tools are correctly registered, exported, and wired into the block with accurate URL construction and response normalisation. The only findings are a leftover apps/sim/tools/hubspot/search_emails.ts and apps/sim/tools/hubspot/search_notes.ts — request body typed as Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[HubSpot Block - operation] --> B{operation type}
B --> C[get_notes]
B --> D[get_emails]
B --> E[create_note / create_email]
B --> F[search_notes / search_emails]
B --> G[get_properties]
B --> H[list_associations]
B --> I[create_association]
C -->|noteId present| C1[hubspot_get_note\n/crm/v3/objects/notes/id]
C -->|no noteId| C2[hubspot_list_notes\n/crm/v3/objects/notes]
D -->|emailId present| D1[hubspot_get_email\n/crm/v3/objects/emails/id]
D -->|no emailId| D2[hubspot_list_emails\n/crm/v3/objects/emails]
E --> E1[POST /crm/v3/objects/notes\nPOST /crm/v3/objects/emails]
F --> F1[POST /crm/v3/objects/notes-emails/search]
G --> G1[GET /crm/v3/properties/objectType\nor /objectType/propertyName]
H --> H1[GET /crm/v4/objects/type/id/associations/toType]
I -->|associationTypeId = null| I1[PUT .../associations/default/toType/toId\nno body, no Content-Type]
I -->|associationTypeId present| I2[PUT .../associations/toType/toId\nJSON body with category + typeId]
Reviews (3): Last reviewed commit: "fix(hubspot): address review comments" | Re-trigger Greptile |
…omments - crm.objects.notes.*/crm.objects.emails.* are not grantable HubSpot scopes (would break the OAuth authorize flow). Notes/emails engagement and association endpoints are authorized by crm.objects.contacts.*; sales-email-read remains for email-engagement content - Remove non-TSDoc inline comments from new tool files
|
@greptile |
|
@cursor review |
- Forward the properties param for the Get Users operation (block param mapping + Properties-to-Return field now include get_users) - Use Record<string, unknown> for create_note/create_email request bodies - Only send Content-Type on create_association when a body is sent (default-association PUT has no body) - Remove stray duplicate JSDoc opener in types.ts
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 73b42db. Configure here.
Summary
get_properties(read property definitions + picklist/enum options), notes (create/get/list/search), email engagements (create/get/list/search), and v4 associations (list/create)sales-email-read(required to read email-engagement content/body). Note/email object + association endpoints are authorized by the existingcrm.objects.contacts.read/writescope — HubSpot does not expose grantablecrm.objects.notes.*/crm.objects.emails.*scopes (verified against HubSpot's OpenAPI security blocks; requesting them would break the OAuth authorize flow).list_marketing_eventslist URL →/marketing/marketing-events/v3hs_appointment_*(werehs_meeting_*)get_usersoutputs → CRM envelope shape (matches/crm/v3/objects/users); forwardspropertiescreate_listnow unwraps the{list}response envelopeassociationsarrayType of Change
Testing
Validated every tool and the block against HubSpot's live OpenAPI specs (parallel audit, all 50 tools PASS).
bun run lint,tsc, andbun run check:api-validationall clean.Checklist