Template Versions
Every time you save a template, DocGenLab automatically creates a new version. This gives you a full audit trail and the ability to roll back to any previous state.
How Versioning Works
- Version 1 is created when you first save a template.
- Each subsequent save increments the version number.
- The most recently saved version is always the active version — it's what gets used when you generate a document.
- Older versions are stored permanently and can be viewed or restored at any time.
Viewing Version History
- Open any template.
- Click the Versions tab.
- You'll see the full list of saved versions with timestamps.
Each version entry shows:
- Version number
- Date and time saved
- A preview of what changed (if available)
Rolling Back to a Previous Version
- Open the Versions tab.
- Find the version you want to restore.
- Click Rollback to this version.
- The selected version becomes the new active version — a new version entry is created (the history is never deleted).
Non-destructive
Rolling back doesn't delete anything. It creates a new version with the content of the older one, so you can always undo a rollback.
API: Fetch a Specific Version
You can retrieve any historical version via API:
# List all versions for a template
curl -X GET "https://api.docgenlab.com/api/v1/templates/TEMPLATE_ID/versions" \
-H "X-API-Key: dgl_your_key_here"
[
{ "version": 3, "created_at": "2024-02-10T14:22:00Z" },
{ "version": 2, "created_at": "2024-02-08T09:11:00Z" },
{ "version": 1, "created_at": "2024-02-01T10:00:00Z" }
]
Document generation always uses the latest active version unless you are referencing a specific past state.
Best Practices
- Add meaningful names / descriptions when saving significant changes — this makes the version list easier to scan.
- Use UAT environment to test new versions before promoting to Production, so Production users are never affected by a work-in-progress template.
- Don't delete templates — use soft-delete (archive) so historical documents that reference the template can still be traced.