X Enterprises
fastify-xhubspot

engagement.createNote

Log a text note against a HubSpot contact.

engagement.createNote

Create a note engagement and associate it with a HubSpot contact.

Signature

fastify.engagement.createNote(
  contactId: string,
  body: string,
  ownerId?: string | null
): Promise<{ id: string; properties: Record<string, string>; createdAt: string }>

Params

NameTypeRequiredDescription
contactIdstringYesHubSpot contact ID to associate the note with.
bodystringYesNote text content.
ownerIdstring | nullNoHubSpot owner ID to assign the note to.

Returns

{ id, properties, createdAt } for the created note.

Throws

  • [xHubspot] engagement.createNote requires a contactId
  • [xHubspot] engagement.createNote requires a body string
  • Re-throws HubSpot API errors.

Examples

Basic

await fastify.engagement.createNote("12345", "Customer requested a demo for Q3.");

Realistic — log a support interaction

fastify.post("/support/tickets/:id/close", async (request) => {
  const { contactId, resolution } = request.body;

  await fastify.engagement.createNote(
    contactId,
    `Support ticket ${request.params.id} resolved: ${resolution}`,
    request.user.hubspotOwnerId
  );

  return { closed: true };
});

See also

AI Context

package: "@xenterprises/fastify-xhubspot"
method: fastify.engagement.createNote(noteData)
use-when: Log a note against a HubSpot contact — associates with a contactId
params: { body (text), contactId, ownerId? }
returns: { id, properties }
Copyright © 2026