Trying to wire up a simple Node.js Lambda to catch Genesys Cloud conversation events via webhook, but the handler keeps choking on the payload structure. I’m using the @middy/serverless-http wrapper to mimic the express middleware pattern I use locally, and the request hits the function, but when I try to access event.body, it’s just a stringified JSON blob that I have to manually parse. Here’s the core of my handler: exports.handler = async (event) => { const body = JSON.parse(event.body); console.log(body.events); }.
The issue is that body.events is undefined, even though I can see the raw JSON in CloudWatch logs contains an events array. I’ve verified the webhook in Genesys Cloud is posting to the correct API Gateway endpoint, and the payload looks standard. Am I missing a specific header or content-type negotiation step in the Lambda config that forces the SDK or middleware to deserialize it automatically? It feels like I’m fighting the framework instead of the API.