Skip to content

Promote a template from Test to Live

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

Copies the template — and all of its channel bodies — from the Test environment into Live, matched by key: created when the key does not yet exist in Live, otherwise overwritten. With dry_run the diff is returned without writing. A promotion whose result is identical is a no-op.

key
required
string
Media type application/json
object
dry_run

If true, return the diff without writing to Live.

boolean

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