# Webhook 500 error

**URL:** <https://community.hubspot.com/t/webhook-500-error/117445>\
**Category:** APIs & Integrations\
**Created:** [October 1, 2024, 2:09pm UTC](https://community.hubspot.com/t/webhook-500-error/117445 "2024-10-01T14:09:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SSingh857](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ssingh857/32/204014_2.png) [@SSingh857](https://community.hubspot.com/u/SSingh857)\
**Post date:** [October 1, 2024, 2:09pm UTC](https://community.hubspot.com/t/webhook-500-error/117445/1 "2024-10-01T14:09:40Z")

</div>

I’m currently testing a Webhook, but I’m encountering 500 errors.  
I have an API endpoint that successfully creates a contact:  
**Endpoint** : localhost:8080/core-api/hubspot-contact/create  
Request Body:  
{  
&nbsp;&nbsp;&nbsp;&nbsp;“firstName”: “test”,  
&nbsp;&nbsp;&nbsp;&nbsp;“lastName”: “test”,  
&nbsp;&nbsp;&nbsp;&nbsp;“email”: “[test2@gmail.com](mailto:test2@gmail.com)”,  
&nbsp;&nbsp;&nbsp;&nbsp;“phoneNumber”: “+911234567899”  
}  
Using this API, I’m able to save the contact details to HubSpot without any issues.  
However, the problem arises when I attempt to create a contact via the Webhook. While the Webhook is supposed to save the details in the database, it returns a 500 error.

---

<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:** [October 2, 2024, 4:50pm UTC](https://community.hubspot.com/t/webhook-500-error/117445/2 "2024-10-02T16:50:16Z")

</div>

Hey, @SSingh857 👋 Thanks for reaching out. It can be tough to trouble shoot issues that are happening in your local environment. I have some troubleshooting steps (organized with the help of our GPT tool) that may give our community members more info to help you track down the issue.

- Check Server Logs — Review logs for more details on what’s causing the 500 error
- Validate Request Payload — Verify the payload matches the expected structure. Compare the manual request (which works) with the webhook’s payload to spot any differences
- Test Locally with ngrok — Use ngrok to expose your local server to the webhook, then test using Postman to simulate the request
- Error Handling — Add error handling in your API to catch issues and return more robust status codes
- Database Check — Confirm database constraints, like unique values, aren’t causing issues when the webhook tries to save the data

Thanks for the additional information! — Jaycee

---

<div class="post-metadata">

**Author:** ![SSingh857](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ssingh857/32/204014_2.png) [@SSingh857](https://community.hubspot.com/u/SSingh857)\
**Post date:** [October 4, 2024, 10:42am UTC](https://community.hubspot.com/t/webhook-500-error/117445/3 "2024-10-04T10:42:45Z")

</div>

I am encountering a 500 Internal Server Error when trying to trigger a HubSpot webhook for the following endpoint:

[https://dev-api.xponentpowerapp.com/core-api/hubspot-contact/webhook](https://dev-api.xponentpowerapp.com/core-api/hubspot-contact/webhook)

However, when testing the same api using Swagger with the following JSON:  
{  
“eventId”: 2296615652,  
“subscriptionId”: 2849063,  
“portalId”: 47283995,  
“appId”: 3828294,  
“occurredAt”: 1728037175074,  
“subscriptionType”: “object.creation”,  
“attemptNumber”: 4,  
“objectId”: 64617102089,  
“objectTypeId”: “0-1”,  
“changeFlag”: “CREATED”,  
“changeSource”: “CRM\_UI”,  
“sourceId”: “userId:70535958”  
}  
it works as expected, without any issues.
