X Enterprises
fastify-xhubspot

engagement.createCall

Log a call engagement against a HubSpot contact.

engagement.createCall

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

Signature

fastify.engagement.createCall(
  contactId: string,
  callData: {
    body?: string;
    callResult?: string;
    callDuration?: number;
    ownerId?: string;
  }
): Promise<{ id: string; properties: Record<string, string>; createdAt: string }>

Params

NameTypeRequiredDescription
contactIdstringYesHubSpot contact ID.
callData.bodystringNoCall notes or summary.
callData.callResultstringNoHubSpot call outcome, e.g., "COMPLETED", "NO_ANSWER", "BUSY". Default: "COMPLETED".
callData.callDurationnumberNoCall duration in milliseconds. Default: 0.
callData.ownerIdstringNoHubSpot owner ID to assign the call to.

Returns

{ id, properties, createdAt }.

Throws

  • [xHubspot] engagement.createCall requires a contactId
  • [xHubspot] engagement.createCall requires a callData object
  • Re-throws HubSpot API errors.

Examples

Basic — log a completed call

await fastify.engagement.createCall("12345", {
  body: "Discussed pricing and next steps. Sending proposal this week.",
  callResult: "COMPLETED",
  callDuration: 12 * 60 * 1000, // 12 minutes in ms
});

From a VoIP webhook

fastify.post("/voip/webhook", async (request) => {
  const { contactId, durationMs, outcome, transcript, ownerId } = request.body;

  await fastify.engagement.createCall(contactId, {
    body: transcript,
    callResult: outcome,
    callDuration: durationMs,
    ownerId,
  });

  return { logged: true };
});

See also

AI Context

package: "@xenterprises/fastify-xhubspot"
method: fastify.engagement.createCall(callData)
use-when: Log a call against a HubSpot contact
params: { body, durationMilliseconds, status, contactId, ownerId? }
returns: { id, properties }
Copyright © 2026