FlaresendDocs
Templates

Restore a template version

Bring back an older version of a stored template as a new version.

POST/v1/templates/{name}/restoreAPI key

Copies the subject, HTML, text and variables of an older version into a new version. History is never rewritten: restoring version 2 of a template that is at version 5 creates version 6 with the content of version 2. Sends use it straight away.

Like Update a template, this fails with 409 template_conflict if the template changes while the restore runs.

Path parameters

namestringpathrequired

The template name.

Body parameters

versionnumberrequired

The version to restore, a whole number from 1. See List template versions.

Response

The template at its new version. Same fields as Retrieve a template.

Errors

StatusCodeWhen
400missing_bodyThe request has no body.
400invalid_bodyversion is missing or not a whole number of at least 1.
404template_not_foundNo stored template with this name. Built-in templates also return this.
404template_version_not_foundThe template has no such version.
409template_conflictThe template changed while the restore ran.