Setting up a Lambda to catch Genesys webhooks. The test event in the console works fine, but live traffic hits the handler with a weird structure.
Here’s the incoming event object:
{
"body": "{\"id\":\"123\",\"name\":\"Test\"}",
"headers": {
"content-type": "application/json",
"x-genesys-timestamp": "1234567890"
}
}
The payload is stringified inside the body property. I’m trying to parse it:
exports.handler = async (event) => {
const data = JSON.parse(event.body);
// ... logic
};
Works locally. In production, event.body is sometimes undefined or empty string when the payload is large. Is there a setting on the webhook endpoint in Genesys that changes this? Or is this standard AWS Lambda behavior for POST requests?
Also, should I be verifying the signature here before parsing?