Lambda handler rejecting Genesys Cloud webhook payload due to unexpected wrapping

The docs state: “Webhook payloads are sent as JSON objects containing event details.”

My Lambda function (Node.js 18) receives the event, but event.body is a string, not an object. I’m parsing it with JSON.parse, yet the structure doesn’t match the schema. The conversation object is nested deeper than expected. Is Genesys Cloud wrapping the payload in an envelope I’m missing? Here’s the snippet:

const data = JSON.parse(event.body);
console.log(data.type);

Nothing logs. Just empty.