X Enterprises
fastify-xhubspot

engagement.getEmails

Retrieve email engagements associated with a HubSpot contact.

engagement.getEmails

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

Signature

fastify.engagement.getEmails(
  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 email engagement. Relevant properties keys include hs_email_subject.

Throws

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

Examples

Basic

const emails = await fastify.engagement.getEmails("12345");

Realistic

fastify.get("/contacts/:id/email-history", async (request, reply) => {
  const emails = await fastify.engagement.getEmails(request.params.id, 20);
  return reply.send({ emails });
});

See also


AI Context

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