Lambda throws TypeError on webhook payload parse when 413 hits

The Lambda handler throws a TypeError: Cannot read properties of undefined (reading 'event_type') the moment it tries to map the raw body from the /api/v2/webhooks/inbound/callbacks trigger. We’ve got the Node.js runtime stripping the application/json header but the paging_token gets nullified when the conversation detail metric crosses 413 limits, which breaks the JSON.parse(event.body) call. CloudWatch dumps this exact fragment:

{ "error": "SyntaxError: Unexpected token < in JSON at position 0", "raw": "<html><body>413 Request Entity Too Large</body></html>" }

The interval_grouping query inside the webhook body gets truncated before the Lambda even hits the context.succeed step.