Promote a workflow's active version from Test to Live
const url = 'https://your-notavia-host/v1/workflows/example/promote';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dry_run":false,"include_templates":["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/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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Workflow key — lowercase alphanumeric + underscore, max 100 chars.
Request Body
Section titled “Request Body ”object
If true, return the diff and cascade candidates without writing to Live.
Keys of referenced templates to promote into Live in the same transaction, before the workflow version is validated and activated.
Responses
Section titled “ Responses ”Promotion result. The diff is returned for both dry runs and applied promotions.
object
True when the promotion was written; false for dry runs and no-op (identical) promotions.
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.
object
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.
object
object
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.
The active Test version number being promoted.
The currently active Live version number, if any.
Per-referenced-template diff against Live; the cascade candidates.
object
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.
object
For workflow promotions, the new Live version number that was created and activated.
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.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Missing or invalid credentials.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Resource not found.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Conflict (e.g. duplicate key, idempotency collision).
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}The promoted version failed semantic validation against the Live environment.
object
object
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}