Agent Scripting API POST 400 Validation Error on Step Sequence

Looking for advice on a validation failure when attempting to create a new agent script via the Platform API. Our integration is designed to programmatically build scripts based on dynamic content, but the POST request to /api/v2/agent-scripts consistently returns a 400 Bad Request. The error payload indicates invalid step sequence without specifying which step is malformed.

  1. Construct the script JSON payload with a single text step followed by a prompt step. The step IDs are unique UUIDs generated client-side.
  2. Set the type field to script and ensure the steps array is ordered correctly.
  3. Execute the POST request using the organization admin token.

The JSON schema validation passes locally, and the structure matches the examples in the developer documentation. We have verified that the step types are supported in the target organization. Is there a hidden dependency between step types that requires specific intermediate nodes, or is this a known issue with the API validator? The environment is on the US-East region, and we are using the latest version of the REST API.