Notes — HubSpot's activity log entries, attached to contacts, companies, deals, or tickets. The agent-facing "log this to the CRM" surface; ::hubspot::engagements covers tasks, calls, meetings, and emails.

Functions

build-note-body

fn (object-type: Str, record-id: Str, body: Str, timestamp-ms: Int): Map

Build the create-note payload for a note attached to a record. Exposed for testing; log-note uses it.

Example

::hubspot::notes/build-note-body("contacts", "123", "Called.", 1762000000000).properties
// {hs_note_body: "Called.", hs_timestamp: 1762000000000}

log-note

fn (object-type: Str, record-id: Str, body: Str): Map
fn (object-type: Str, record-id: Str, body: Str, opts: Map): Map

POST /crm/objects/{version}/notes - Attach a note to a contact, company, deal, or ticket, timestamped now.

Example

::hubspot::notes/log-note("contacts", "12345", "Demo went well; sending pricing.")

note-association-type-id

fn (object-type: Str): Int

The HUBSPOT_DEFINED association type id linking a note to a record type (contacts 202, companies 190, deals 214, tickets 228). Exposed for testing.

Example

::hubspot::notes/note-association-type-id("deals")  // 214