Contact creation produces two different calls to the webhook

Highlighted
New Contributor

When a contact or company is created in HubSpot I usually get one single call to my webhook. The payload has a "contact.creation" notification and then one "contact.propertychange" per each field that was filled in the UI when creating the contact.

 

But sometimes I get the notifications in two different calls to the webhook. One call with just the "contact.creation" and the "contact.propertychange" ones in a different one.

 

Is that normal behaviour? For me that's a problem, for instance, if I get a call in my webhook with only property change notifications, that will be treated as a contact update, not as a contact creation. And I can't create an empty contact in my system.

 

Would it be possible to get all the notifications related to a contact or company creation in a single call to the webhook always?

 

Thanks.

Reply
0 Upvotes
4 Replies 4
Highlighted
HubSpot Moderator

Hi @alesvi 

 

This would suggest that your App has multiple subscriptions in-place in the Webhooks section. 

 

When a contact is creation, you should be correctly receiving the contact.creation notification but if you're also receiving the contact.propertyChange notification, this is because you're subscribed to this property change event and when a the contact is being created, it is triggering this notification as it matches the subscription criteria. 

 

As an example, I have created a test Webhook now and have 1 subscription:
contact.creation

 

When a contact is created, I am seeing the 1 notification triggered. However, if I update this to include a secondary subscription of:

contact.creation

contact.propertyChange - FirstName Change

 

I am then seeing that I get 2 notifications as the creation of the contact adds a new record and updates the FirstName field of the record to include a new value, which counts as a property change. 

 

If you do not wish to see this double notification, you will need to remove the subscription for the contact.propertyChange event.

 

I hope this helps!

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

Hi Wilson, thanks for your answer.

 

But I think I dind't explain myself properly. I do want to get those two notifications, one for contact.creation and another one for contact.propertyChange. The problem is that sometimes I get them as the payload of just one call to my webhook, which is fine. But some other times I get them in different calls to my API, as different batches.

 

 

Captura.JPG

 

As you can see in the screenshot, I got those two notifications in two different batches, despite of being part of the same change, the creation of that contact.

 

What I want is to get them in the same batch, so I can process them as a single change.

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi @alesvi 

 

As they're 2 different subscriptions, we'd expect them to be sent in 2 batches as you've stated. 


Can you provide an example where this is not the case? 

Matthew Willson

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

Yes, check this case:

 

 

 

Captura.JPG

 

I did exactly the same that before, create a contact. But in this case I got all the notifications in the same batch. 

What I'm asking is if I can get all the notifications that belong to the same creation always in one single batch. 

 

For you those are 3 different changes and 3 different notifications. But that's only how HubSpot considers it. For me, as a HubSpot user, it's only one change: contact created with FirstName A and LastName B. If I get them in the same batch, I can group them and process them as a single change. Getting them in different calls to my API makes processing quite more complex.

 

 

Reply
0 Upvotes