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
| Name | Type | Required | Description |
|---|---|---|---|
contactId | string | Yes | HubSpot contact ID to associate the note with. |
body | string | Yes | Note text content. |
ownerId | string | null | No | HubSpot 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
- engagement.createTask — create a follow-up task instead
- engagement.getNotes — list all notes for a contact
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 }
