SCALIX help

← All tools

hubspot_create_note

HubSpot write medium risk

Part of the HubSpot Agent.

What it does

Create a Note engagement in HubSpot and associate it with a contact and/or deal, used to log a LinkedIn ad touchpoint (e.g., 'Engaged with Sponsored Content campaign X on 2026-06-20; LP click; lead-form submit'). Requires hs_note_body (the text) and hs_timestamp (ISO-8601 or epoch ms of the activity). Associations are set inline using HUBSPOT_DEFINED type ids: note->contact = 202, note->deal = 214. Returns the standard envelope {success:true,data} where data is {applied, result}; result is HubSpot's created note (id, properties, createdAt, updatedAt, archived) plus associations_created: the associations sent with the create. HubSpot applies them with the create, all or nothing (an invalid one fails the whole create), so a success confirms every link - no hubspot_associate_objects call is needed. Use this to record ad-touchpoint context on the timeline so the agent can map ad activity to deals/contacts for attribution. Two-phase (ADR-028/029, the same gate as Google and LinkedIn writes): the first call (no preview_id) builds the request locally and returns a preview_id - nothing is sent to HubSpot; after the user approves that preview in a later message, re-call with that preview_id and identical arguments to COMMIT (single-use, 30 min; a changed, forged or replayed token fails closed). Where consent_confirmed exists it must be true at preview and at commit. [POLICY] Log touchpoints ONLY for the authorizing client's own contacts/deals using that client's consented, first-party ad data; never write LinkedIn member profile/social-activity data into note bodies beyond what consent and retention allow, and never use notes to stash enriched or cross-client data. [REMINDER] Provide hs_timestamp for the activity time and associate to the right record(s); keep PII minimal. [WHEN TO USE] Use to log an approved, client-owned ad touchpoint or interaction on a contact/deal timeline; do NOT use to persist member-derived data past retention or to annotate non-client records.

When to use it

Use to log an approved, client-owned ad touchpoint/interaction on a contact or deal timeline; do NOT persist member-derived data past retention or annotate non-client records.

Inputs

NameTypeRequiredDescription
hs_note_bodystringyesNote text (the touchpoint description). Keep PII minimal; HTML allowed but plain text preferred. Bounded length -- very long bodies are rejected/truncated.
hs_timestampstringyesRequired. ISO-8601 UTC or epoch milliseconds; the server never fills it in (a server-side now() would change between preview and commit).
contact_idstringnoContact record id to associate the note with (uses HUBSPOT_DEFINED associationTypeId 202).
deal_idstringnoDeal record id to associate the note with (uses HUBSPOT_DEFINED associationTypeId 214).
consent_confirmedbooleanyesMust be true: caller attests the note content and target are the client's own, consented data within retention limits.
preview_idstringnoOmit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview.

Safeguards

A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.

Policy

Log touchpoints ONLY for the authorizing client's own contacts/deals using that client's consented, first-party ad data. NEVER write LinkedIn member profile/social-activity data into note bodies beyond consent/retention (profile <=24h, social activity <=48h caches), and never use notes to stash enriched or cross-client data. Honor deletion-on-request.

Reminder

Set hs_timestamp to the real activity time and associate to the correct record(s); keep PII minimal.

Errors

Error classMeansWhat to doRetry
authInvalid or expired OAuth token / session (401 Unauthorized).Refresh the HubSpot OAuth token and retry; do not reuse the rejected token.no
permissionToken lacks crm.objects.contacts.write (notes have no scope of their own) or the associated object's write scope (403 Forbidden).Grant crm.objects.contacts.write and the associated object's write scope and reconnect; surface the missing scope.no
validationHubSpot 400: missing hs_timestamp/hs_note_body, malformed timestamp, or wrong associationTypeId for note->target. Surface HubSpot's exact message.Provide a valid ISO/epoch hs_timestamp, non-empty body, and correct type ids (202 contact / 214 deal); re-preview then retry.no
not_foundAn association target (contact/deal) does not exist (404 Not Found).Verify the contact_id/deal_id exist (upsert/create first); then retry.no
rate_limitHubSpot 429 Too Many Requests (TEN_SECONDLY_ROLLING or daily policy).Honor Retry-After/X-HubSpot-RateLimit-*; back off with jitter.yes
platformHubSpot server error (500/502/503).Retry with exponential backoff; if persistent, report HubSpot unavailability.yes
invalid_argumentHubSpot API 2026-09 enforces this portal's validation rules on every write (conditionally required properties, properties required at creation, the Edit Associations permission). A violation is a 400 VALIDATION_ERROR: when errors[].code is MISSING_* the tool returns invalid_argument naming the rule and the property; any other invalid value returns invalid_argument with HubSpot's own message.Supply the property the rule names, or fix the value HubSpot's message names (HubSpot internal property names), then re-preview. For "Missing 'Edit Associations' permission." no argument change helps: a HubSpot admin must give the user who connected Scalix the Edit Associations permission (Settings > Users & Teams), then re-preview.no

Edge cases

  • hs_timestamp is REQUIRED for engagements -- omitting it errors or defaults to now, misordering the timeline; always pass the true activity time.
  • Notes are NOT idempotent -- re-posting the same touchpoint creates a duplicate; dedupe by checking the timeline or a deterministic external-key custom property before retry.
  • Association type ids are direction/object specific: note->contact 202, note->deal 214 (HUBSPOT_DEFINED).
  • A note can associate to multiple records in one call (e.g., both contact and deal).
  • hs_note_body length is bounded by HubSpot (very long bodies are truncated/rejected) -- keep concise.
  • Retention/consent: do not embed LinkedIn member profile data older than 24h or social activity older than 48h; block if consent_confirmed is false.