I have a webhook created in a Priavte App on Hubspot that hits a custom endpoint whenever a ticket is created, updated, etc. However, Hoever, I have 2 external integrations that can creat tickets, one is a custom one and the other is through a zapier job. The only events I can able are the Zapier ones. I noticed that whenever a webhook event of “changeSource”: “INTEGRATION” comes thorugh it als contains a “sourceId”. From my testing these Id havent seemed to change. The Zapier request always come throught with one Id and the Custom App request always comes through with another.
I intend to use this Id as a sort of filter in my custom app. I pull out this Id and say is this an Id I do/dont want to handle.
Can I expect thise sourceId to alwasy stay the same for these integrations? Or do they change over time by some unknown trigger?
I’d suggest using the record id (hs_object_id) as the ID that is referenced. That is the internal uniquie ID that is set to that record in HubSpot
I may not have explained my scenario correctly. Im no so much as trying to reference the ticketId but trying to identify the source of the Integration request that created the ticket.
Hey @MThibodeaux,
In HubSpot’s webhook payloads, the sourceId field within the changeSource object identifies the specific integration or source responsible for a change. While sourceId values are generally consistent for a given integration, HubSpot does not officially guarantee their immutability. Therefore, relying solely on sourceId for filtering may not be entirely reliable in the long term.
Understanding changeSource and sourceId:
- changeSource: Indicates the origin of the change, such as “INTEGRATION”, “CRM_UI”, or “API”.
- sourceId: Provides a unique identifier for the specific source or integration that made the change.
Further Read: https://community.hubspot.com/t5/APIs-Integrations/ChangeSource-INTEGRATION-how-to-distinguish-them/m-p/718576 and Hubspot Webhook Documentation
Best,
Kosala