Skip to content

Create a new draft version

POST
/v1/workflows/{key}/versions
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.

key
required
string
/^[a-z][a-z0-9_]{0,99}$/

Workflow key — lowercase alphanumeric + underscore, max 100 chars.

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"
}

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
nullable
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
nullable
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
nullable
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
nullable
Example generated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}