# Webhooks test - 400 error

**URL:** <https://community.hubspot.com/t/webhooks-test-400-error/111976>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [July 15, 2024, 3:41pm UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976 "2024-07-15T15:41:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigDawg5508](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@BigDawg5508](https://community.hubspot.com/u/BigDawg5508)\
**Post date:** [July 15, 2024, 3:41pm UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/1 "2024-07-15T15:41:40Z")

</div>

Hello,

I’ve created a webhook subscription, seemingly meeting any and all pre-requisite requirements. This subscription is for the contacts.created event.

I’ve provisioned the URL, as well as the POST endpoint (HTTPS) and accepting the expected JSON payload.

However, when testing the API from within Hubspot, I only receive a 400 error.

Any assistance would be greatly appreciated!

---

<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:** [July 16, 2024, 4:45pm UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/2 "2024-07-16T16:45:47Z")

</div>

Hi, @BigDawg5508 👋 Thanks for reaching out. Is this webhook set up using a Private App or using a Public App? Hey @dsmarion @PBaxter @stefen, do you have any webhook setup troubleshooting tips you can share with @BigDawg5508?

Thank you very much for taking a look! — Jaycee

---

<div class="post-metadata">

**Author:** ![BigDawg5508](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@BigDawg5508](https://community.hubspot.com/u/BigDawg5508)\
**Post date:** [July 17, 2024, 10:59am UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/3 "2024-07-17T10:59:20Z")

</div>

[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) , thank you so much for your reply. It is a private app, and I have to do a small walk of shame, because I did identify the issue…

When I created my object for deserialization from the JSON payload sent from the Hubspot webhook, ‘apparently’ I created the ‘objectId’ field as a string vs. a number 😞

When I changed the type to a number (as shown in the webhooks docs/screenshot) all was good in the world again. Total rookie move and my apologies for taking up your time for an error on my behalf.

 ![schema.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/6/263bbf0badbcedf7bc02e7c4a3f9596e13f01efe.png)

---

<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:** [July 17, 2024, 7:27pm UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/4 "2024-07-17T19:27:57Z")

</div>

Hey, @BigDawg5508 👋 Thanks for taking the time to come back and let us know how you solved the issue. I definitely learn from my mistakes and my victories 😊 — Jaycee

---

<div class="post-metadata">

**Author:** ![BigDawg5508](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@BigDawg5508](https://community.hubspot.com/u/BigDawg5508)\
**Post date:** [July 17, 2024, 11:40am UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/5 "2024-07-17T11:40:19Z")

</div>

Howeve maybe I spoke to soon. The ‘testing’ of the webhook works fine now. However, when I created a contact and the webhook triggered, I actually still receive the 400/bad request.

See the Postman request and response below. For now, my API is just echoing the request back in the response.

 ![postman.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/6/26e5eb19127c94b0dfef33df039ba19005946406.png)

---

<div class="post-metadata">

**Author:** ![AddaxLab](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/addaxlab/32/26380_2.png) [@AddaxLab](https://community.hubspot.com/u/AddaxLab)\
**Post date:** [July 16, 2024, 5:17pm UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/6 "2024-07-16T17:17:02Z")

</div>

Hey @BigDawg5508,  
We do not have enough information here, and it would be great to have more details.  
A 400 error occurs when a browser sends a request to a web server that the server cannot understand or process correctly. So, check what type of data your API expects—webhooks send an array of objects but not an object (this is a pretty common mistake)

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/6/e6571a3bbb77d0173122c40f4e7fc7790ee2f093.png)

---

<div class="post-metadata">

**Author:** ![BigDawg5508](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@BigDawg5508](https://community.hubspot.com/u/BigDawg5508)\
**Post date:** [July 17, 2024, 11:05am UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/7 "2024-07-17T11:05:43Z")

</div>

Hey @AddaxLab , so definitely 10-4 on the 400, and yes, I may have said ‘object’ in my original post but my API is in fact setup to receive a JSON array. However, a rookie movie on my part that I happened to notice yesterday. ‘Apparently’ when I created my object that the Hubspot payload would be deserialized to, in error I created the ‘objectId’ field as a string vs a number lol. So, when it tried to deserialize it, it was failing and a 400 in this case definitely makes sense. So, another case of a dev just going to quickly and making a rookie mistake.

I can’t thank you enough for reaching out to assist!!

---

<div class="post-metadata">

**Author:** ![BigDawg5508](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@BigDawg5508](https://community.hubspot.com/u/BigDawg5508)\
**Post date:** [July 17, 2024, 11:40am UTC](https://community.hubspot.com/t/webhooks-test-400-error/111976/8 "2024-07-17T11:40:49Z")

</div>

Howeve maybe I spoke to soon. The ‘testing’ of the webhook works fine now. However, when I created a contact and the webhook triggered, I actually still receive the 400/bad request.

See the Postman request and response below. For now, my API is just echoing the request back in the response.

 ![postman.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/6/26e5eb19127c94b0dfef33df039ba19005946406.png)
