X Enterprises
fastify-xhubspot

engagement.getTasks

Retrieve task engagements associated with a HubSpot contact.

engagement.getTasks

Returns full property objects for all task engagements associated with a given HubSpot contact.

Signature

fastify.engagement.getTasks(
  contactId: string,
  limit?: number
): Promise<Array<{ id: string; properties: Record<string, string> }>>

Params

NameTypeRequiredDescription
contactIdstringYesHubSpot contact ID.
limitnumberNoMaximum number of results to return. Defaults to the HubSpot API default (100).

Returns

Array of { id, properties } for each matching task engagement. Relevant properties keys include hs_task_subject and hs_task_status.

Throws

  • [xHubspot] engagement.getTasks requires a contactId
  • Re-throws HubSpot API errors on network failure after logging via fastify.log.error.

Examples

Basic

const tasks = await fastify.engagement.getTasks("12345");

Realistic

const tasks = await fastify.engagement.getTasks("12345");
const openTasks = tasks.filter(t => t.properties.hs_task_status !== "COMPLETED");

See also


AI Context

package: "@xenterprises/fastify-xhubspot"
method: fastify.engagement.getTasks(contactId, limit?)
use-when: List task engagements for a given HubSpot contact
returns: Array<{ id, properties }>
Copyright © 2026