Skip to main content
Aarunya AppsAarunya Apps

HubSpot CRM Webhook TypeScript Types (Contact Created)

TypeScript interfaces for the HubSpot CRM contact.creation webhook event. Use these types when building HubSpot integrations and automations.

HubSpot CRM — Sample JSON

{
  "subscriptionType": "contact.creation",
  "portalId": 12345678,
  "appId": 54321,
  "eventId": 1000,
  "subscriptionId": 987654,
  "attemptNumber": 0,
  "objectId": 123456789,
  "changeSource": "FORM",
  "occurredAt": 1711928400000,
  "objectType": "CONTACT",
  "propertyName": "email",
  "propertyValue": "new.contact@example.com"
}

Generated TypeScript

export interface HubSpotContactEvent {
  subscriptionType: string;
  portalId: number;
  appId: number;
  eventId: number;
  subscriptionId: number;
  attemptNumber: number;
  objectId: number;
  changeSource: string;
  occurredAt: number;
  objectType: string;
  propertyName: string;
  propertyValue: string;
}

How to use

Copy the TypeScript above into a types.ts file in your project. Import the root interface and use it to type your API responses: const data: HubSpotContactEvent = await res.json()

Working with a different JSON payload? Paste any JSON and generate TypeScript interfaces instantly.

Convert your own JSON →

FAQ

What is the objectId in a HubSpot webhook?

The objectId is the HubSpot ID of the CRM record that triggered the event — in this case, the contact ID. You can use it to fetch the full contact record via the HubSpot CRM API: GET /crm/v3/objects/contacts/{objectId}.

What does attemptNumber mean in HubSpot webhooks?

HubSpot retries webhook delivery if your endpoint returns a non-200 response. attemptNumber starts at 0 for the first delivery and increments with each retry. HubSpot retries up to 10 times with exponential backoff. Process idempotently using eventId to avoid duplicates.

How do I handle multiple subscription types with one webhook endpoint?

Use the subscriptionType field to route to the correct handler: if (event.subscriptionType === 'contact.creation') { ... } else if (event.subscriptionType === 'contact.propertyChange') { ... }. You can also subscribe to specific events per webhook URL in HubSpot settings.

Powered by Aarunya Apps