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.
- Construct the script JSON payload with a single
textstep followed by apromptstep. The step IDs are unique UUIDs generated client-side. - Set the
typefield toscriptand ensure thestepsarray is ordered correctly. - 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.