Skip to content

Promote a workflow's active version from Test to Live

POST
/v1/workflows/{key}/promote
curl --request POST \
--url https://your-notavia-host/v1/workflows/example/promote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dry_run": false, "include_templates": [ "example" ] }'

Promotes the currently active Test version of the workflow into Live as a new version and activates it; the previous Live version is retained for rollback. Referenced templates that are missing or out of date in Live can be promoted in the same atomic operation via include_templates. With dry_run the diff and cascade candidates are returned without writing.

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

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

Media type application/json
object
dry_run

If true, return the diff and cascade candidates without writing to Live.

boolean
include_templates

Keys of referenced templates to promote into Live in the same transaction, before the workflow version is validated and activated.

Array<string>

Promotion result. The diff is returned for both dry runs and applied promotions.

Media type application/json
object
applied
required

True when the promotion was written; false for dry runs and no-op (identical) promotions.

boolean
status
required

new — the key does not yet exist in Live. changed — it exists in Live and differs. identical — it exists and matches, so promotion is a no-op.

string
Allowed values: new changed identical
template_diff
object
key
required
string
status
required

new — the key does not yet exist in Live. changed — it exists in Live and differs. identical — it exists and matches, so promotion is a no-op.

string
Allowed values: new changed identical
name
required
string
Allowed values: added removed modified unchanged
bodies
required
Array<object>
object
channel
required
string
subject
required
string
Allowed values: added removed modified unchanged
text
required
string
Allowed values: added removed modified unchanged
html
required
string
Allowed values: added removed modified unchanged
structured
required
string
Allowed values: added removed modified unchanged
workflow_diff
object
key
required
string
status
required

new — the key does not yet exist in Live. changed — it exists in Live and differs. identical — it exists and matches, so promotion is a no-op.

string
Allowed values: new changed identical
name
required
string
Allowed values: added removed modified unchanged
description
required
string
Allowed values: added removed modified unchanged
body
required
string
Allowed values: added removed modified unchanged
source_version

The active Test version number being promoted.

integer
nullable
target_current_version

The currently active Live version number, if any.

integer
nullable
referenced_templates
required

Per-referenced-template diff against Live; the cascade candidates.

Array<object>
object
key
required
string
status
required

new — the key does not yet exist in Live. changed — it exists in Live and differs. identical — it exists and matches, so promotion is a no-op.

string
Allowed values: new changed identical
name
required
string
Allowed values: added removed modified unchanged
bodies
required
Array<object>
object
channel
required
string
subject
required
string
Allowed values: added removed modified unchanged
text
required
string
Allowed values: added removed modified unchanged
html
required
string
Allowed values: added removed modified unchanged
structured
required
string
Allowed values: added removed modified unchanged
target_version

For workflow promotions, the new Live version number that was created and activated.

integer
nullable
Example
{
"status": "new",
"template_diff": {
"status": "new",
"name": "added",
"bodies": [
{
"subject": "added",
"text": "added",
"html": "added",
"structured": "added"
}
]
},
"workflow_diff": {
"status": "new",
"name": "added",
"description": "added",
"body": "added",
"referenced_templates": [
{
"status": "new",
"name": "added",
"bodies": [
{
"subject": "added",
"text": "added",
"html": "added",
"structured": "added"
}
]
}
]
}
}

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

Conflict (e.g. duplicate key, idempotency collision).

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

The promoted version failed semantic validation against the Live environment.

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