Intermittent error: "Invalid JSON input: a request body was expected, but none found"
Hey everyone! We seem to be getting an HTTP status code 400 from HubSpot every so often. The error will state, "Invalid JSON input: a request body was expected, but none found." However, we've checked everything, and we definitely are sending a request body when this happens; we've added logging to our calls just to double check, and it does look like we are sending a body, as well as a Content-Type and Content-Length header.
The error does not seem to be contained to any one endpoint. We've seen the error on:
POST https://api.hubapi.com/crm/v3/objects/:customObjectId:/search
Intermittent error: "Invalid JSON input: a request body was expected, but none found"
Are you able to check the logs in Hubspot and see what payload they received? Usually for API request errors, Hubspot let's you see the entire request and response.
Intermittent error: "Invalid JSON input: a request body was expected, but none found"
Hey Michael! Yes, so I was able to see some of the logs for the HubSpot apps that are getting these errors.
It looks like, for the endpoint "crm/v3/objects/contacts/batch/read", the HubSpot logs are reporting, "No body was received for this request." However, my application logs indicate that I sent a request body with a Content-Length of 3352. The request ID is af7e3842-0021-48e6-9563-b4128f2bb674 and account ID is 3299556. This happened on March 20, 2025 10:43 AM EDT.
It's like something in the middle between me and the HS API is stripping out the body. I don't see anything unusual about the body, it's just me asking for the contact IDs that are associated with a couple of emails that I'm passing along.
Intermittent error: "Invalid JSON input: a request body was expected, but none found"
That's very odd.
My next step would be switching out the hubpot endpoint with a webhook address that I control to verify that data is actually being sent. Assuming the result SHOULD be the same, then it must be either something between your server/app and Hubspot/any endpoint (server firewall?).
There are a few free sites (obviously remove your sensitive information) that you can use like webhook.site or webhook.cool or even Zapier/Workato.
Perhaps it's a specific record? Or maybe some data isn't being escaped properly? Or isn't being processed properly?