Determine the source account of a webhook event

Hello everybody!

I am new to HubSpot API and need to implement webhooks for different accounts. So, basically, I will have a single endpoint receiving webhook events from different accounts (previously OAuth’ed).

I have been playing with my test account and the request body of an event my endpoint receives looks something like this:

[
 {
 "eventId": 2011967717,
 "subscriptionId": 428977,
 "portalId": 9260291,
 "appId": 238200,
 "occurredAt": 1611254646072,
 "subscriptionType": "contact.creation",
 "attemptNumber": 0,
 "objectId": 101,
 "changeFlag": "NEW",
 "changeSource": "CONTACTS"
 }
]

Is there any way of finding the HubSpot account the event object belongs to? I can’t find anything like that in the HTTP request body or headers.

Hi @lgomez

Apologies for delayed response!

The account is equivalant to the portalID.

If you reference this page, you will see definitions for the payload in the Webhook Payload section

Thank you, @dennisedson.