Create a new draft version
POST
/v1/workflows/{key}/versions
const url = 'https://your-notavia-host/v1/workflows/example/versions';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"body_json":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-notavia-host/v1/workflows/example/versions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "body_json": "example" }'Parses the supplied JSON body against the workflow DSL. Returns the
new version number. The version is left in Draft status; call
activate to promote it.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key
required
string
Workflow key — lowercase alphanumeric + underscore, max 100 chars.
Request Body required
Section titled “Request Body required ” Media type application/json
object
body_json
required
Full workflow definition JSON. Must conform to the workflow DSL
schema (fetch from GET /workflows/schema.json). The server
runs the structural parser at creation time; semantic validation
(category existence, template bodies, expression syntax) runs
only at activation.
string
Example generated
{ "body_json": "example"}Responses
Section titled “ Responses ”Draft version created.
Media type application/json
object
id
required
string format: uuid
version
required
integer
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "version": 1}Validation or request error.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Missing or invalid credentials.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Resource not found.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}