POST /api/v2/flows/executions returning 400 Bad Request with 'Invalid flow execution request' on custom agent desktop

Trying to trigger an Architect flow programmatically from a custom agent desktop app using the REST API. The goal is to launch a specific flow based on a button click in the embeddable client, passing the current user ID and a custom data payload.

I’m using the standard POST endpoint /api/v2/flows/executions.

Here’s the request I’m sending:

const response = await fetch('https://api.mypurecloud.com/api/v2/flows/executions', {
 method: 'POST',
 headers: {
 'Content-Type': 'application/json',
 'Authorization': `Bearer ${token}`
 },
 body: JSON.stringify({
 flowId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
 inputs: {
 userId: 'current-agent-id',
 customData: { reason: 'manual_trigger' }
 }
 })
});

The response is a 400 Bad Request. The body looks like this:

{
 "code": "bad_request",
 "message": "Invalid flow execution request",
 "details": "The flow execution request is invalid.",
 "status": 400
}

I’ve verified the flowId is correct and the flow is enabled. The token has the flow:execute scope. I tried removing the inputs block entirely, but the same 400 error persists. I also checked the flow settings to ensure it allows external execution, which it does.

The docs are pretty sparse on what constitutes an ‘invalid’ request beyond schema validation. Has anyone hit this specific error when calling the execution endpoint directly? What am I missing in the payload structure?