Webhook failing with 400 - payload seems valid?

Hey all, sorry if this is a dumb one, but I’m kinda stuck. We’ve got a webhook set up to handle agent status changes - basically, when an agent goes Available/Not Ready/etc, we need to push an event to Kafka. It was working fine for a few days, then it just started failing.

The webhook is listening on a simple HTTP endpoint exposed by a MuleSoft flow. The Genesys Cloud webhook configuration is pretty basic - just the URL, content type set to application/json, and basic auth. We’re on Genesys Cloud, and the SDK version we’re using in our Java code for the connection stuff is 6.6.0.

The errors in Genesys Cloud show a 400 Bad Request. The interesting part is, when I copy the payload directly from the Genesys Cloud webhook event logs and POST it to the MuleSoft endpoint with curl, it works perfectly. No issues. So the payload looks valid to me, but something’s off with how Genesys is sending it?

Here’s a snippet of the event payload I’m seeing in the Genesys Cloud logs:

{
 "eventTime": "2024-02-29T14:32:00.123Z",
 "eventType": "agentStateChange",
 "topic": "agent",
 "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
 "data": {
 "agentId": "12345",
 "state": "NOT_READY",
 "reason": "Lunch"
 }
}

The MuleSoft flow is really simple - it just parses the JSON and publishes a message to a Kafka topic. I’ve checked the authentication, and it’s definitely matching. I suspect it has something to do with headers, or maybe some subtle difference in how the Genesys Cloud webhook sends the request versus curl.

I tried adding logging in the MuleSoft flow to dump the raw headers, but it’s doing jack all. The logs are empty. Is there anything obvious I’m missing? Maybe a specific header that needs to be present? It’s super frustrating. I’m a beginner, so I feel like I’m overlooking something fundamental.