POST /api/v2/flows/executions returns 400 Invalid Flow Parameter

How come this setting causes a 400 error when launching a flow via the REST API from my Node.js Lambda handler? I am sending a minimal payload with the flowId and a single variable, but the response insists the parameter is invalid even though the flow exists and is published.

The request looks like this:

POST /api/v2/flows/executions
{
 "flowId": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
 "variables": [
 { "name": "source", "value": "api_test" }
 ]
}

I have verified the OAuth token has the flow:execute scope. The flow runs fine manually in the UI. Is there a strict schema requirement for the variables array that I am missing?

The problem here is the variables array structure is wrong for v2; it requires name and value strings, not nested objects. Fix the payload to [{"name": "source", "value": "api_test"}] as detailed in this internal note.

Have you tried switching to the PureCloudPlatformClientV2 SDK instead of raw HTTP? The startFlowExecution method handles serialization correctly, avoiding manual JSON construction errors that trigger 400s.

Warning: Ensure the flow is published and the OAuth scope includes flow:execute.