POST /api/v2/flows/executions returns 400 Invalid parameter in external integration

We are launching an Architect flow programmatically from our .NET backend using the POST /api/v2/flows/executions endpoint. The request includes the valid flow ID and a JSON body with the required parameters. However, the response consistently returns a 400 Bad Request with a message indicating an invalid parameter. The flow works fine when triggered manually. Here is the cURL equivalent and payload structure we are using.

I’ve seen this exact 400 error pop up when the execution context is missing mandatory fields that the UI fills in automatically. The API is strict about what goes into execution_context. You probably need to explicitly pass the channel and contact_uri even if you’re just testing.

Try updating your payload to include a minimal context structure. Here’s what worked for me in a similar .NET integration:

{
 "flow_id": "your-flow-id",
 "execution_context": {
 "contact_uri": "tel:+15550199",
 "channel": "voice",
 "user_id": "your-user-id"
 }
}

If you leave execution_context out or empty, the platform throws that generic invalid parameter error. Also, double-check that the user ID you’re passing has the view:flow and view:interaction scopes. The flow running manually uses the agent’s context, but your script needs an explicit identity.

Are you using the PureCloudPlatformClientV2 SDK or raw HTTP requests in your .NET backend? The execution_context requirements shift depending on how you’re authenticating. is spot on about the missing fields, but there’s another trap. If your flow expects specific custom attributes, you need to pass them in the initial_attributes object, not just the context. The API won’t auto-populate those like the UI does.

Here’s a payload that usually clears the 400 error for external triggers:

{
 "flowId": "your-flow-id",
 "execution_context": {
 "channel": "external",
 "contact_uri": "ext:12345",
 "user_id": "authenticated-user-id"
 },
 "initial_attributes": {
 "customField1": "value1"
 }
}

Make sure user_id matches a valid user or integration identity. If you’re still hitting the error, check the flow’s entry conditions. Sometimes a missing user_id causes the flow to reject the execution before it even checks the attributes.