Promote a template from Test to Live
const url = 'https://your-notavia-host/v1/templates/example/promote';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"dry_run":false}'};
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/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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body
Section titled “Request Body ”object
If true, return the diff without writing to Live.
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" }}