# object named 'undefined' in Webhook API event data

**URL:** <https://community.hubspot.com/t/object-named-undefined-in-webhook-api-event-data/98737>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [January 26, 2024, 10:16am UTC](https://community.hubspot.com/t/object-named-undefined-in-webhook-api-event-data/98737 "2024-01-26T10:16:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lennart-sve](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lennart-sve/32/5494_2.png) [@lennart-sve](https://community.hubspot.com/u/lennart-sve)\
**Post date:** [January 26, 2024, 10:16am UTC](https://community.hubspot.com/t/object-named-undefined-in-webhook-api-event-data/98737/1 "2024-01-26T10:16:29Z")

</div>

Hello,  
I am using the [Webhook API](https://developers.hubspot.com/docs/api/webhooks) to subscribe to

company.associationChange events. I receive the events as expected, but the event data looks like this:

```lia-code-sample
{
 "method": "unknown",
 "data": {
 "undefined": {
 "eventId": 'censored',
 "subscriptionId": 'censored',
 "portalId": 'censored',
 "appId": 'censored',
 "occurredAt": 1706262994435,
 "subscriptionType": "company.associationChange",
 "attemptNumber": 0,
 "changeSource": "USER",
 "associationType": "COMPANY_TO_CONTACT",
 "fromObjectId": 'censored',
 "toObjectId": 'censored',
 "associationRemoved": false,
 "isPrimaryAssociation": false
 }
 },
 "query": {}
}

```

The problem here being that the object containing the event data is inside an object named “undefined”. I am guessing this is not expected behavior. Can we rely on referencing “undefined” in this API version, or will it be fixed and changed to something that makes sense which would be a breaking API?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 26, 2024, 7:08pm UTC](https://community.hubspot.com/t/object-named-undefined-in-webhook-api-event-data/98737/2 "2024-01-26T19:08:51Z")

</div>

Hey, @lennart-sve That is unexpected for sure. Do you get the same or similar response when for other webhooks? I am not sure if you’ve tested other variations.

Thanks for the additional information! — Jaycee

---

<div class="post-metadata">

**Author:** ![lennart-sve](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lennart-sve/32/5494_2.png) [@lennart-sve](https://community.hubspot.com/u/lennart-sve)\
**Post date:** [January 29, 2024, 9:13am UTC](https://community.hubspot.com/t/object-named-undefined-in-webhook-api-event-data/98737/3 "2024-01-29T09:13:29Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074),  
I did test a few other variants. When I try

contact.associationChange I get the same structure with undefined as the object name.  
However, with for example company.creation, I get this structure which makes more sense:

```lia-code-sample
"data": {
 "9795991267": {
 "eventId": 1852872255,
 "subscriptionId": 'censored',
 "portalId": 'censored',
 "appId": 'censored',
 "occurredAt": 1706519193462,
 "subscriptionType": "company.creation",
 "attemptNumber": 0,
 "objectId": 'censored',
 "changeFlag": "CREATED",
 "changeSource": "CRM_UI",
 "sourceId": "userId:censored"
 }
 },

```

So it seems to be a general issue for the associations webhook, but not the other objects, perhaps?
